Question: 1)I need help to create an acceptable pseudocode which prints out all the values less than a given value in a binary min-heap . The

1)I need help to create an acceptable pseudocode which prints out all the values less than a given value in a binary min-heap.

The given value might not be in the heap. We can assume the array representation of a binary min-heap with the first element stored at index 0.

In the general case, the algorithm should not examine every element in the heap. The algorithm does not change the heap.

2)What is the worst-case input for your algorithm? Describe both the state of the heap as well as the given value.

3)Give a tight asymptotic runtime bound for the worst case. Briefly explain your answer.

1)I need help to create an acceptable pseudocode which prints out all

Pseudocode guidelines Pseudocode means that you don't have to write every line in Java with correct syntax. English explanations of operations are acceptable. In general, you may substitute English for any constant-time operation. The following example is not acceptable pseudocode. scan the list and count all elements less than x The following example is acceptable pseudocode. while the list has elements: increment the counter if the current element is greater than x move to the next element of the list The idea is that you don't have to give all the nitty-gritty coding details, but you should demonstrate a clear understanding of what your algorithm does and where those nitty-gritty details would have to go. To indicate blocks of code, either use braces {} or indentation levels

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!