Skip to content

Implementation of classic data structures and algorithms

License

Notifications You must be signed in to change notification settings

shilongdai/DataStructures

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DataStructures

This library provides implementations of classic algorithms and datastructures.

Organization

The project is divided into two packages, algorithms and structure. The algorithms package contains implementations of mostly stand alone algorithms while the structure package contains data structures and algorithms that exclusively operates on them.

Algorithms

Here is a list of algorithms under the algorithms package:

In binarySearch.py:

In expression.py:

In problemSolver.py:

In sort.py:

Structure

Here is a list of implemented data structures and algorithms that operates on them:

In linkedList.py:

In unionFind.py: https://en.wikipedia.org/wiki/Disjoint-set_data_structure

  • Quick Find: Disjoint set implemented with array like data structure. O(1) find.
  • Quick Union: Disjoint set implemented with parent link tree.
  • Balanced Quick Union: Disjoint set implemented with parent link tree and balancing on union. O(log(N)) efficiency for find and union.
  • Path Compression Quick Union: Disjoint set implemented with parent link tree and augmented with path compression.
  • Balanced Path Compression Quick Union: Disjoint set implemented with parent link tree with balancing and path compression. almost amortized O(1) efficiency on find and union.

In symbolTable.py:

In heap.py:

In graph.py:

Usage

All of the components are tested. However, they are not tested to rigorous production standards. Data structures such as the linked list and symbolTables have interfaces like the standard python list and dictionary.