Question: 2 . Add a method in AVL _ tree.h as follows. ( 4 0 pts ) bool immediate _ predecessor ( Record &key ) const;

2. Add a method in AVL_tree.h as follows. (40 pts)
bool immediate_predecessor(Record &key) const;
The method looks for the immediate predecessor of the input key in the AVL-tree. If not found, the method returns false. Otherwise, it returns true and place the found immediate predecessor in key.
Note that if the given key is less than any record currently in the tree, its immediate predecessor does not exist. Also note that it is possible that key does not exist in the tree. But you can still find its immediate predecessor as long as key is not less than all the records currently in the tree.
 2. Add a method in AVL_tree.h as follows. (40 pts) bool

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!