Welcome to Day 39 of the DSA Coding Challenge:
Todays Goals(Binary Trees):
-Binary Tree and Binary Search Trees Data Structure Crash Course
Question 1:Construct BST
Design a Binary Search Tree class that supports the following:
1.Insert a value
2.Remove a value. This method should remove the first occurrence of a value.
3.Find a value. If the value is found it should return the node with the value else return false.
Question 2:Traverse BST
Write a 4 instance methods for a Binary Search Tree class to traverse the BST.
1. Method 1 : traverse the tree breadth first and return an array that contains all the values of the BST.
2. Method 2: traverse the tree depth first – In-order and return an array that contains all the values of the BST.
3. Method 3 : traverse the tree depth first – Pre-order and return an array that contains all the values of the BST.
4. Method 4 : traverse the tree depth first – Post-order and return an array that contains all the values of the BST.
All the best!