Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started