|
|
|
|
|
__contains__(self,
item)
sequential search method pre: self, item to be searched post: True if
list contains the item, False otherwise |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
__iter__(self)
built-in class method, makes LinkedList objects iterable pre: self
post: self.head, first Node on the list |
source code
|
|
|
|
__len__(self)
class method that returns the number of items in the list pre: self
post: returns number of items in the list |
source code
|
|
|
|
|
|
|
__reversed__(self)
built-in class method, makes LinkedList objects reverse iterable pre:
self post: self.head, first Node on the list |
source code
|
|
|
|
append(self,
item)
class method that appends the given item at the end of the list pre:
self, item |
source code
|
|
|
|
|
|
|
count(self,
item)
class method that counts the number of occurances of item... |
source code
|
|
|
|
extend(self,
otherLinkedList)
class method that extends the list by adding otherLinkedList at the
end of the self pre: self, otherLinkedList |
source code
|
|
|
|
|
|
|
index(self,
item)
class method that returns the index of the first occurance of item,
returns None if there is no any item. |
source code
|
|
|
|
insert(self,
position,
item)
class method that inserts item to the given position pre: self,
position, item position should not be greater than length of the list |
source code
|
|
|
|
peek(self,
index=None)
class method that retrieves, but does not remove, the head (first
element) of this list pre: self post: the data of the head of the
list or None if the list is empty |
source code
|
|
|
|
pop(self,
index=None)
class method that removes the item at the given position in the list,
and returns it. |
source code
|
|
|
|
remove(self,
item)
class method that removes the first occurrence of the given item if
there is one pre: self, item |
source code
|
|
|
Inherited from object:
__delattr__,
__format__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__setattr__,
__sizeof__,
__str__,
__subclasshook__
|