Skip to content

A repository created to practice writing Binary Search tree methods

Notifications You must be signed in to change notification settings

dre-create/tree-practice

This branch is 3 commits ahead of Ada-C15/tree-practice:master.

Repository files navigation

Tree Exercise

In this exercise you will implement, in Ruby, several Tree methods.

  • add(value) - This method adds a key-value pair to the Binary Search Tree
  • find(value) - This method returns the matching value for the given key if it is in the tree and None if the key is not found in the tree.
  • Traversals: These methods return an array of dictionaries consisting of all the key-value pairs in the tree in a specific order.
    • inorder - This method returns an array of all the elements in the tree, in order.
    • postorder - This method returns an array of all the elements in a postorder fashion (left, right , root).
    • preorder - This method returns an array of all the elements in a preorder fashion (root, left, right).
  • height - This method returns the height of the binary search tree.

Optionals

About

A repository created to practice writing Binary Search tree methods

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 90.1%
  • Dockerfile 9.6%
  • Shell 0.3%