def __init__(self): self.size = 0 self.storage = LinkedList()
def __init__(self): self.__storage = LinkedList()
def __init__(self): self.size = 0 # Store Data through invocation of the LinkedList self.storage = LinkedList()
def set(self, key, value) -> None: hashed_key = self.__hash(key) if not self.__data[hashed_key]: self.__data[hashed_key] = LinkedList() self.__add_to_bucket(self.__data[hashed_key], (key, value)) self.__length += 1
from singly_linked_list.singly_linked_list import LinkedList linked_list = LinkedList(1) linked_list.append(2) linked_list.append(3) linked_list.append(4) linked_list.append(5) linked_list.append_left(6) linked_list.insert(3, 7) linked_list.insert(0, 10) print(linked_list) linked_list.remove_at_index(linked_list.size() - 1) print(linked_list) linked_list.remove_value(3) print(linked_list) linked_list.reverse() print(linked_list) print(linked_list.pop()) print(linked_list) print(linked_list.pop_left()) print(linked_list)
def __init__(self): self.size = 0 self.storage = LinkedList( ) #singly_linked_list.LinkedList() is what I had before that made this work
def __init__(self): self.size = 0 self.storage = LinkedList() self.head = None self.tail = None
def __init__(self, size=0): self.size = size self.storage = LinkedList()
def __init__(self): self.size = 0 self.storage = LinkedList() self.front = None self.rear = None