Python implementations of some algorithms from the CLRS textbook https://en.wikipedia.org/wiki/Introduction_to_Algorithms
- Insertion sort
- Insertion sort in non-ascending order
- Mergesort
- Heapsort
- draw_heap() - a function that draws a visual representation of the heap - useful for debugging!
- Quicksort
- Randomized quicksort
- Counting sort
- random(a, b) - generates a random number between a and b using random(0, 1)
- Randomize an array in-place
-
Rod cutting problem
- Recursive solution
- Top-down memoized solution
- Bottom-up solution
-
Longest common subsequence
- Breadth-first search (bfs.py)
- Depth-first search (dfs.py)
- Topological sorting of a directed acyclic graph (DAG) (dfs.py)
- Bellman-Ford algorithm for graphs with negative edges
- Dijkstra's algorithm