/python-dataStructures-implementation

Linked List, Stack and Queue implemented in Python3

Primary LanguageJupyter NotebookThe UnlicenseUnlicense

Data Structures implementation in Python3.

Linked List, Stack and Queue implemented in Python3. All the methods of the classes listed below were tested using unit tests.

Linked list

Node:

  • get_value: return the value
  • get_next: return the next node
  • set_next: set the next node

myLinkedList:

  • add_first: adding an element at the front
  • add_last: adding an element at the end
  • remove_first: removing a node at the front
  • list_traversal: every node in the list has been seem

myStack

  • push: adds an element to the stack
  • peek: returns the last added element but does not remove it
  • pop: removes the most recent element added

myQueue

  • enqueue: adds an element to the rear of the queue
  • peek: returns the front most element from the queue but does not remove it
  • dequeue: returns and removes the front most element from the queue
  • isEmpty: checks if queue is empty