Repository to house both new and refactored versions of implemented data structures.
I've done some learning over the past few months, and I think it's already time to revisit approaches to these common data structures.
Below summarizes the data structure. Complexity is the worst case scenario.
To-do:
- Test data-structures against existing implementations for robustness.
- Implement additional data-structures.
- Add CI.
- Incorporate the following where possible:
- try/except
- namedtuples
- generators
-
Parameters:
- Accepts an iterable as an optional parameter.
-
Attributes:
- head
-
Methods:
- push
- pop
- size(len interactive)
- search
- remove
- display(str interactive)
-
Complexity: O(n)
A composition of a linked list that utilizes its pop and push methods.
-
Parameters:
- Takes an optional argument of any data type as the value of the node.
-
Attributes:
- No public attributes
-
Methods:
- push
- pop
- len interactive
-
Complexity: O(n)
-
Parameters:
- Takes no arguments.
-
Attributes:
- tail
- head
-
Methods:
- push
- pop
- size(len interactive)
- shift
- append
- remove
-
Complexity: O(n)
-
Parameters:
- Takes no arguments.
-
Attributes:
- No attributes.
-
Methods:
- enqueue
- dequeue
- peek
- size
-
Complexity: O(n)
-
Parameters:
- Takes no arguments.
-
Attributes:
- No attributes.
-
Methods:
- append
- appendleft
- pop
- popleft
- peek
- peekleft
- size (len interactive)
-
Complexity: O(n)