Skip to content

muniri92/Data-Structures-2.0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data-Structures-2.0


Binary Search Tree

  • This is a data structure composed of Nodes.
  • Included methods are:
    1. insert
    2. contains
    3. size
    4. depth
    5. balance

Traversal Methods

- Various methods for traversing the graphs
1. in_order(self):  will return the values in the tree using in-order traversal, one at a time.
2. pre_order(self):  will return the values in the tree using pre-order traversal, one at a time.
3.post_order(self):  will return the values in the tree using post_order traversal, one at a time.
4. breadth_first(self): will return the values in the tree using breadth-first traversal, one at a time.

Helpful Resource to better understand how to implement the breadth first traversal: (http://stackoverflow.com/questions/1894846/printing-bfs-binary-tree-in-level-order-with-specific-formatting)

Delete Method

- Remove value from the tree if present, if not present this method is a no-op. Return None in all cases

Balance Method

-  Balance the tree upon the insertion or the deletion of a node. This allows for the Binary Search Tree to be as optimal as possible. 

Hash Table

  • This structure hashes keys and stores the value. Essentialy we created what Python's dictionary does. It lets the user set the number of buckets to store words and then hashes the keys and stores them at the correct index of the list of lists.

Methods available:

  • get - returns the value of a given key
  • set - sets a key value pair

Insertion Sort

Merge Sort

Quick Sort

Radix Sort

#Trie

  • This structure is used specifically for lexicon completion situations such as autocomplete.

Methods Available:

  • insert: Insert a token into the Trie
  • Contains: See if a token has been entered into the Trie

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages