data-structures-and-algorithms

tree-breadth-first

Create a Node class

Create a BinaryTree class

Create a BinarySearchTree class

Authors

Authors: Emad Idris

Challenge

BinaryTree should have these five different methods:

.preOrder() ()
Input: the binary tree the method is called on
Output: array of values using preOrder sort

.inOrder() ()
Input: the binary tree the method is called on
Output: array of values using preOrder sort

.postOrder() ()
Input: the binary tree the method is called on
Output: array of values using inOrder sort

.findMaximumValue(arr) (takes in an array returned by one of the methods above)
Input: an array returned by preOrder(), inOrder() or postOrder()
Output: an integer with the maximum value found in the tree

.breadthFirst() ()
Input: the binary tree the method is called on
Output: array of values using breadth first, level order sort

BinarySearchTree should have these two different methods:

.add(value) (adds a node with value to the binary search tree)
Input: a value object to add to the binary tree at the proper location
Output: none

.contains(value) (searches for a value in the binary search tree)
Input: a value to search for in the tree
Output: a boolean representing whether or not the value is in the tree

Approach & Efficiency

Big O Notation

Testing

Write tests to prove the following functionality:


Whiteboard(s)

cc17

TEST

Test


Pull Request