Algorithms and Data Structures implemented in Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
LICENSE
README.md
autoresizelist.py
binary_search_tree.py
breadth_first_search.py
city_data.json
combinatorics.py
depth_first_search.py
dijkstra.py
fib.py
get_city_data.py
hashtable.py
heap.py
heap_speed_test.py
mergesort.py
nqueens.py
prefix_calc.py
quicksort.py
reverse.py
straight_city_distances.json

README.md

Algorithm Implementations

This is just a collection of algorithms I wanted to implement in order to improve my understanding. They are NOT optimized and probably shouldn't be used in production code.

To run all unit tests:

python3 -m unittest discover test

quicksort

Recursive implementation of the quick sort algorithm.

To run tests:

python3 quicksort.py

mergesort

Recursive implementation of the merge sort algorithm.

To run tests:

python3 mergesort.py

hashtable

Simple hashtable implementation

autoresizelist

A helper class used to implement the heap.

To run tests:

python3 autoresizelist.py

heap

Implementation of a heap.

To run tests:

python3 heap.py

nqueens

Backtracking solution to the n-queens problem (just finds the first one).

To run:

python3 nqueens.py

To run tests:

python3 -m unittest discover test --pattern="*nqueens*"

combinatorics

Various combinatoric functions like permutations and combinations.

To run:

python3 combinatorics.py