subject

Consider a priority queue has been implemented as a binary max heap and is stored as an array.

80 18 40 13 25

array representation of the heap:

index 0 1 2 3 4 5 6 7 8 9
value 80 18 40 13 5 25 1 2 9
note that -

0th position is left empty

left child of a[ i ] can be found at a[ 2 * i ].

right child of a[ i ] can be found at a[ 2 * i + 1 ].

the parent of a[ i ] is at a[ i / 2 ].

now a pop-heap operation is called on this data structure. what will be the array after this pop?

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:00
You install teamviewer on your workstation at home so that you can ac ess it when on the road. how can you be assured that unknown users cant access your computer through team viewer?
Answers: 2
question
Computers and Technology, 22.06.2019 06:00
Write a program that uses a widgetviewer object to do the following: generate two random integers between 1 and 9 (inclusive). name one of them x, the other y. display them to the user using jlabel objects. create a jlabel object displaying the text "enter an operation number." create a jtextfield for the user's input. create a jbutton displaying the text "press here when you've entered your operation." use addandwait to add it to the widgetviewer object. when the user clicks the jbutton, evaluate operation in the following order to determine the one and only mathematical operation to perform on x and y. use a jlabel to display the result. if operation is between 1 and 10 inclusive, add x and y. if operation is evenly divisible by 4, subtract y from x. if operation is evenly divisible by 5, use integer division to divide y into x. if operation is an even number, use floating point division to divide y into x. if none of the other tests on operation apply, multiply x and y. note: operation can be negative or zero.
Answers: 2
question
Computers and Technology, 22.06.2019 07:30
Jasper and samantha are in a robotics competition. the guidelines state that the robots should be able to move a 10-gram weight at least 2 meters and turn in a circle. jasper and samantha have already built the robot. which step of the design process should they follow next to decide whether their robot meets the minimum criteria for the competition?
Answers: 1
question
Computers and Technology, 22.06.2019 11:00
Ihave an iphone 8plus should i get another phone like samsung note 9 or s9 ? ?
Answers: 2
You know the right answer?
Consider a priority queue has been implemented as a binary max heap and is stored as an array.
...
Questions
question
Mathematics, 11.05.2021 08:00
question
Mathematics, 11.05.2021 08:00
question
Mathematics, 11.05.2021 08:00
question
Mathematics, 11.05.2021 08:00
question
Mathematics, 11.05.2021 08:00
question
Mathematics, 11.05.2021 08:00
question
Mathematics, 11.05.2021 08:00