Implementations of data structures and algorithms in various languages for educational purposes.
- Install RubyGems
- Install Rake (
gem install rake
)
- Run
cabal update
(this should be included in the Haskell Platform) - Run
cabal install --only-dependencies
- Install rebar
rake test
cabal configure --enable-tests && cabal build && cabal test
cabal configure --enable-benchmarks && cabal build && cabal bench
rebar compile eunit
rebar compile && rebar escriptize && ./carbon_erlang
(benchmarks)
Statuses: 0 todo. 1 in progress. 2 implemented but could use improvements, cleanup, or minor additions. 3 stable.
- Implementation of a multiset with a self balancing binary tree
- Balanced with rotations only when needed
- TODO: benchmarking, remaining tests
- Matrices model with related mathematical operations/concepts (e.g. vectors, matrix multiplication, row reduction)
- Implementation of a binary max heap
- insertion only traverses (one path of the) tree once (
log(n)
) - removal only travels (one path of the) tree twice (necessary to retrieve the latest node and bubble down) (
2logn
) - TODO: generalize max/min heap, comparison function?
- Backed by binary heap
- TODO: benchmarking, documentation
- introsort (done)
- heapsort (with pairing heap)
Ordered set backed by a left leaning red black tree
- sorting identify stable/unstable, time complexity, depth, etc.
- erlang benchmarks
- use more functional paradigm (e.g. fold instead of loop)
- avoiding extra tree traversals in a functional language
- writing a generic print binary tree function (with a single traversal)