The Serve( ) function returns the highestpriority item that will be the maximum
ID: 3611859 • Letter: T
Question
The Serve( ) function returns the highestpriority item that will be the maximum heap element .TheEnqueue ( ) function inserts an input value intoheap. “Enqueue ( )” function first add a new node tothe tree. Then it traverses a path from this lead toward the rootto find a proper place for this new element.
Write pseudo code for Serve( ) andEnqueue ( ) function.
b) Suppose H is amin heap containing n keys (elements). We want to write a functionprintSmaller() that prints all the keys in H thatare smaller than a given input key x .
Explanation / Answer
…