Question: Let M be an ordered map with n entries implemented by means of an AVL tree. Show how to implement the following operation on M
Let M be an ordered map with n entries implemented by means of an AVL tree. Show how to implement the following operation on M in time O(logn+s), where s is the size of the iterator returned.
find All In Range(k1,k2): Return an iterator of all the entries in M with key k such that k1 ≤ k ≤ k2.
Step by Step Solution
3.33 Rating (168 Votes )
There are 3 Steps involved in it
We will implement a method findAllInRangeNodev k1 k2 where v is a node in D since findAllInRangek1 ... View full answer
Get step-by-step solutions from verified subject matter experts
