Skip to content

RobinvdGriend/binary_search_tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

BinarySearchTree

This is a limited implementation of a binary search tree in Ruby using a node class with references to its child nodes. The node class contains functions for node insertion and searching and a helper method BinarySearchTree::build_tree is included to easily build a tree from an array of values.

Using this library

To use this library in your code simply:

require "path/to/lib/binary_search_tree.rb"

This will automatically require all the class files necessary for the library.

Implementation

The binary search tree does not use self-balancing. To avoid severely unbalanced or even degenerate tree the array passed to BinarySearchTree::build_tree is randomized. This implementation does not support deletion of nodes.

About

Simple binary search tree implementation in ruby

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages