Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/djo/algorithms

Basic Algorithms written in Ruby
https://github.com/djo/algorithms

Last synced: 7 days ago
JSON representation

Basic Algorithms written in Ruby

Awesome Lists containing this project

README

        

## Basic Algorithms written in Ruby
[![Build Status](https://secure.travis-ci.org/Djo/algorithms.png "Build Status")](http://travis-ci.org/Djo/algorithms)

#### Fundamentals

* [The greatest common divisor](lib/gcd.rb)
* [Transpose of a matrix in Linear Algebra](lib/matrix.rb)
* [Find the k-th smallest value in the array](lib/find_kth.rb)
* [Work with a linked list](lib/linked_list.rb)
* [Dijkstra's two-stack algorithm for expression evaluation](lib/expressions.rb)
* [Union-find algorithm (weighted quick-union implementation)](lib/union_find.rb)

#### Sorting

* [Selection sort](lib/selection_sort.rb)
* [Insertion sort](lib/insertion_sort.rb)
* [Shell sort](lib/shell_sort.rb)
* [Top-down mergesort](lib/merge_sort.rb)
* [Bottom-up mergesort of a linked list](lib/merge_sort_bu.rb)
* [Quick sort](lib/quick_sort.rb)
* [Quick 3-way sort](lib/quick3way_sort.rb)
* [Heap sort](lib/heap_sort.rb)
* [Max-oriented priority queue](lib/priority_queue.rb)

#### Searching

* [Check if a binary tree is balanced](lib/btree.rb)
* [Find the 'next' node (in-order successor) of a given node in a binary search tree](lib/bst.rb)

#### Graphs

* [Depth-first search](lib/dfs.rb)
* [Finding a directed cycle](lib/directed_cycle.rb)

#### Strings

* [Least-significant-digit first string sort](lib/lsd.rb)

Development:

bundle install
bundle exec rake test

Copyright (C) 2013-2014 [Andrew Djoga](http://andrewdjoga.com), released under the MIT license.