The 2-d heap is a data structure that allows each item to have two individual

Chapter 12, Problem 12.20

(choose chapter or problem)

The 2-d heap is a data structure that allows each item to have two individual keys.deleteMin can be performed with respect to either of these keys. The 2-d heap isa complete binary tree with the following order property: For any node X at evendepth, the item stored at X has the smallest key #1 in its subtree, while for anynode X at odd depth, the item stored at X has the smallest key #2 in its subtree.a. Draw a possible 2-d heap for the items (1, 10), (2, 9), (3, 8), (4, 7), (5, 6).b. How do we find the item with minimum key #1?c. How do we find the item with minimum key #2?d. Give an algorithm to insert a new item into the 2-d heap.e. Give an algorithm to perform deleteMin with respect to either key.f. Give an algorithm to perform buildHeap in linear time.

Unfortunately, we don't have that question answered yet. But you can get it answered in just 5 hours by Logging in or Becoming a subscriber.

Becoming a subscriber
Or look for another answer

×

Login

Login or Sign up for access to all of our study tools and educational content!

Forgot password?
Register Now

×

Register

Sign up for access to all content on our site!

Or login if you already have an account

×

Reset password

If you have an active account we’ll send you an e-mail for password recovery

Or login if you have your password back