Skip to content

kurtrm/data_structures_rev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Revised Data Structures

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

Linked List

  • Parameters:

    • Accepts an iterable as an optional parameter.
  • Attributes:

    • head
  • Methods:

    • push
    • pop
    • size(len interactive)
    • search
    • remove
    • display(str interactive)
  • Complexity: O(n)

Stack

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)

Doubly Linked List

  • Parameters:

    • Takes no arguments.
  • Attributes:

    • tail
    • head
  • Methods:

    • push
    • pop
    • size(len interactive)
    • shift
    • append
    • remove
  • Complexity: O(n)

Queue

  • Parameters:

    • Takes no arguments.
  • Attributes:

    • No attributes.
  • Methods:

    • enqueue
    • dequeue
    • peek
    • size
  • Complexity: O(n)

Dequeue

  • Parameters:

    • Takes no arguments.
  • Attributes:

    • No attributes.
  • Methods:

    • append
    • appendleft
    • pop
    • popleft
    • peek
    • peekleft
    • size (len interactive)
  • Complexity: O(n)

About

Repository to house both new and refactored versions of implemented data structures.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages