This is an implementation of several common algorithms (and data structures) in Ruby. Much of it comes from algorithm descriptions in Introduction to Algorithms.
Sorting Algorithms:
- merge sort
- insertion sort
- heap sort
- quick sort
- counting sort
- radix sort
- bucket sort
Algorithms:
- max subarray (recursive, not optimal)
- kadane's algorithm (optimal max subarray algorithm)
- minmax
- kth number (selection)
- rod cutting
- longest common subsequence
- longest increasing subsequence
Solutions to Common Problems:
- fibonacci (recursive, dp, matrix)
- string permutations
- random array permutations (including knuth shuffle)
- change-making problem (dynamic programming)
- activity selection problem (greedy)
Data Structures:
- Binary Heap
- Linked List