Skip to content

dosart/Linear-data-structures

Repository files navigation

Linear-data-structures

Maintainability CitHub_CI wemake-python-styleguide

Implementation of classic linear data structures:

The project was made as part of the Coding Interview University course.

Stack implementation:

  • push(value) - adds item at storage
  • pop() - returns value and removes element
  • empty() - bool returns true if empty

Queue implementation:

  • enqueue(value) - adds item at end of available storage
  • dequeue() - returns value and removes least recently added element
  • empty()

Linked list implementation:

  • size() - returns number of data elements in list
  • empty() - bool returns true if empty
  • value_at(index) - returns the value of the nth item (starting at 0 for first)
  • push_front(value) - adds an item to the front of the list
  • pop_front() - remove front item and return its value
  • push_back(value) - adds an item at the end
  • pop_back() - removes end item and returns its value
  • front() - get value of front item
  • back() - get value of end item
  • insert(index, value) - insert value at index, so current item at that index is pointed to by new item at index
  • erase(index) - removes node at given index
  • value_n_from_end(n) - returns the value of the node at nth position from the end of the list
  • reverse() - reverses the list
  • remove_value(value) - removes the first item in the list with this value

Calculations:

  • implementation of the shunting station algorithm
  • implementation of postfix expression calculations