1. Suppose that you wanted the remove operation of a priority queue to remove the entry whose priority value is smallest instead of largest. You would then use a min heap. Convert the max heap implementation to a minheap implementation.
2. Suppose that you wanted to maintain the index of the item with the smallest value in a max heap. That is, in addition to a get Top operation, you might want to support a get Min operation. How difficult would it be to maintain this index within the add and remove operations?
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here