Question: 2 . Add a method in AVL _ tree.h as follows. ( 4 0 pts ) bool immediate _ predecessor ( Record &key ) const;
Add a method in AVLtree.h as follows. pts
bool immediatepredecessorRecord &key const;
The method looks for the immediate predecessor of the input key in the AVLtree. 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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
