Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a pseudocode function which takes two parameters: heap 1 and heap 2 , and returns an integer. The function should return the 3 rd

Write a pseudocode function which takes two parameters: heap1 and heap2, and returns an integer. The function should return the 3rd largest number contained in both
heaps. Both heap1 and heap2 are maxheaps containing integers, and both heaps have at least 3 elements.
For example, if heap1 contains 10,7,6,4,1 and heap2 contains 8,4,3 your function should return 7. If heap1 contains 10,7,4 and heap2 contains 5,4,3 your function
should return 5. It is acceptable if heap1 and heap2 are changed during the function call.
Assume you have a class Heap implemented which implements the following heap functions discussed in the videos and textbook (and only the following functions).
bronze(heap1: Heap, heap2: Heap): integer
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions