Question: 1. [Heap, 15 pts| Write a method in pseudocode or java that takes two heaps as inputs and outputs a heap that contain all elements

 1. [Heap, 15 pts| Write a method in pseudocode or java

1. [Heap, 15 pts| Write a method in pseudocode or java that takes two heaps as inputs and outputs a heap that contain all elements of the two given heaps. The heaps are given in a linked-list representation. The time complexity of your method should be O(log(m+n), where m and n are number of nodes in the two inputs heaps. Your method should be called public MergeHeap(Heap h, Heap g)

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!