1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Mamont248 [21]
3 years ago
5

Chegg Suppose the heap is a full tree, size 2^n-1. what is the minimum number of steps to change a min heap to a max heap. Show

your logic.
Computers and Technology
1 answer:
adoni [48]3 years ago
4 0

Answer:

Explanation:

We start from the bottom-most and rightmost internal node of min Heap and then heapify all internal modes in the bottom-up way to build the Max heap.

To build a heap, the following algorithm is implemented for any input array.

BUILD-HEAP(A)

   heapsize := size(A)

   for i := floor(heapsize/2) downto 1

       do HEAPIFY(A, i)

   end for

Convert the given array of elements into an almost complete binary tree.

Ensure that the tree is a max heap.

Check that every non-leaf node contains a greater or equal value element than its child nodes.

If there exists any node that does not satisfy the ordering property of max heap, swap the elements.

Start checking from a non-leaf node with the highest index (bottom to top and right to left).

You might be interested in
Select all that apply.
Molodets [167]

The Big Five Factor: neuroticism, extraversion, openness, and conscientiousness.

3 0
3 years ago
A set of blocks contains blocks of heights 1,2, and 4 centimeters. Imagine constructing towers of piling blocks of different hei
SashulF [63]

Answer:

In studies about new medicines, researchers usually give one group of patients the medicine that is designed to treat an illness. They give another group of patients a placebo, which is taken the same way as the medicine but does not actually contain the ingredients of any medicine. Different medicines are tested in different experiments, but the placebos usually contain the same non-medical ingredients. If both groups of patients are healed, then researchers cannot be sure whether the medicine caused improvement, but if the group given the medicine is healed while the group given the placebo remains ill, researchers can conclude that the medicine causes the illness to go away.

In medical experiments, which group receives placebos?

the experimental group

the control group

both the experimental and control groups

neither the experimental nor control group

Explanation:

5 0
3 years ago
Why is computer called information processing maching???​
Vaselesa [24]

☆ <u>Since, the computer accepts raw data as input and converts into information by means of data processing, it is called information processing machine (IPM).</u>

HOPE IT HELPS ❣️

7 0
3 years ago
Read 2 more answers
6
Lisa [10]

Answer C in the paragraph group on the home tab

8 0
3 years ago
Why is Brainly always deleting either my answers or my questions? I am putting nothing inappropriate in them. Can someone answer
Artist 52 [7]

Answer:

hey i do not know

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • Businesses sometimes achieve uninterruptible service by using a technology known as ____ to keep a mirror copy of all their data
    11·1 answer
  • A program called the ______ combines the object program with other programs in the library and is used in the program to create
    5·1 answer
  • Suppose you want your firewall to block all incoming Telnet connections but to allow outbound Telnet connections. One approach w
    9·1 answer
  • Help me I'm so confused by this question
    7·1 answer
  • Which of the following can spreadsheet programs help a person with? (choose all that apply.)
    9·1 answer
  • Short note on first generation computer​
    10·1 answer
  • The process of giving the user the result of processing is called
    14·1 answer
  • A user input is when the user interacts with the program by typing.<br> True<br> False
    11·2 answers
  • Choose the correct term to complete the sentence.
    12·1 answer
  • I'm having trouble with an assignment of mine. I'm making a text based adventure game for extra credit in my class and I'm stuck
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!