/algorithms

implementations of standard data types and algorithms

Primary LanguageRuby

algorithms

implementations of standard data types and algorithms in Ruby, JavaScript, and C

Dynamic Array

implements a dynamic array class on top a simulated static "C" array class as a linear array with O(n) shift/unshift and as a ring buffer with amortized O(1) shift/unshift.

HashMap, Linked List, and LRU cache

building up data structures from simpler one in stages using simple hashing functions in Ruby, doubly-linked list also in C.

Quicksort

out-of-place and in-place implementations of Quicksort with random pivot

JavaScript Algorithms

JavaScript implementations of Mergesort, Bubblesort, Quicksort, and Binary Search

Binary Search Tree

a simple Ruby implementation of a binary search tree using Hibbard deletion

Heap

implementation of a Binary Min Heap (without index map) and Heapsort

Graphs

Adjacency List representation of a graph and Kahn's and Tarjan's topological sorting algorithms; implementation of a Binary Min Heap (with index map), Priority Map, Dijkstra shortest path

Dynamic Programming

simple example problems for dynamic programming (recursion with caching of past results)