Question: Question No:3 (15 marks) Write a C++ code for given an array as {14, 13, 10.9, 8, 7, 6, 5, 4, 3. 1) construct the

Question No:3 (15 marks) Write a C++ code for given an array as {14, 13, 10.9, 8, 7, 6, 5, 4, 3. 1) construct the binary search tree. Write three functions as: a) printTree ) print the BST using array and identifying the root of BST. b) printRange() that given the pointer to the root to a BST, a low key value, and a high key value, prints in all sorted order records whose key values fall between the two given keys. Function printRange() should visit as few nodes in the BST as possible. c) removeOutsideRange() that takes range (4.9) as an input argument and remove all keys which are outside the given range in linear time. The modified tree should also be BST
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
