Question: Design and implement a dynamic linked binary search tree (BST) using C++ classes including the following methods: o isEmpty ( ) - returns an integer
Design and implement a dynamic linked binary search tree (BST) using C++ classes including the following methods:
o isEmpty ( ) - returns an integer or enumerated bool type; true for an empty BST, false for non-empty BST
o insert ( ) allocates a node dynamically; initializes it to the data passed in; inserts the node into the left or right subtree; returns true or false for successful or unsuccessful insertion, respectively
o inOrder ( ) performs an inorder traversal of a BST and prints out the data in the nodes accordingly
o preOrder ( ) performs a preorder traversal of a BST and prints out the data in the nodes accordingly
o postOrder ( ) - performs a postorder traversal of a BST and prints out the data in the nodes accordingly
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
