Question: Write a C++ program for implementing a simple binary search tree capable of storing numbers. The class should have member functions void insert (double x)

Write a C++ program for implementing a simple binary search tree capable of storing numbers. The class should have member functions void insert (double x) void search (double x) void inorder (vector & v) The insert function should not use recursion directly, or indirectly by calling a recursive function. The search function should work by calling a private recursive member function bool search (double x, BtreeNode *t) The inorder function is passed an initially empty vector v: it fills v with the inorder list of numbers stored in the binary search tree. Allow the user to enter 5 values to store in the tree structure. Then prompt the user to enter a value to search. If the value is found in the tree structure, let the user know. If the value is not found in the tree structure, let the user know this as well.

Functions/Methods used throughout. Function main() should be small.

Class created with the following methods:

insert - is not created recursively and does not call a recursive function directly or indirectly

search - calls recursive function search

inorder - uses a vector

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!