Algorithmable
Useful algorithms such as Sorting Strategies, Searches and Data Structures such as Priority Queues, Symbol Tables, Binary Search Tree BST, Red Black tree RBT, Hash Tables, Bag, Linked List, Deque, Queue (FIFO), Stack (LIFO), Graphs & Graph Traversal strategies for everyday usage.
Algorithms and Data Structures implemented using Ruby, for fun.
Library also contains solutions for several puzzles solved by implemented algorithms and data structures.
Data Structures
- Bag (primitive collection without ability to delete elements)
- Singly Linked List
- Doubly Linked List
- Deque (double-ended queue)
- Queue (FIFO)
- Stack (LIFO)
- Ordered Symbol Table BST. Implementation using Unbalanced Binary Search Tree.
- Minimum Priority Queue
- Maximum Priority Queue
- Ordered Symbol Table
Graphs
- Undirected graph
Graph Traversals
- Breadth First Search (BFS)
- Depth First Search (DFS)
Search Algorithms
- Binary Search
Sorting Algorithms
- Bubble sort
- Merge sort
- Heapsort ( Binary Heap )
Algorithms
- Levenshtein Distance algorithm (http://www.levenshtein.net)
- Lawrence Philips' Metaphone Algorithm (http://aspell.net/metaphone)
Puzzles
- Shunting-yard algorithm ( Dijkstras two stacks algorithm )
- Josephus problem
Usage
It is always better to check unit tests in order to understand how things going on. Most of the components are encapsulated through the factory methods, so the are could be mixed to other objects.
Installation
Add this line to your application's Gemfile:
gem 'algorithmable'
And then execute:
$ bundle
Or install it yourself as:
$ gem install algorithmable
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/rlishtaba/algorithmable. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.