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
Suppose you have one particular application that is trying to send data on the Internet but none of the data is making it to the
CaHeK987 [17]

Answer:

Firewall is blocking that application.

Explanation:

i got it right on the test and i hope yall have a great day :3

4 0
3 years ago
Read 2 more answers
Commercial applications are never free<br><br> -True<br><br> -False
Ber [7]

Answer:

False

Explanation:

Commercial applications such as google and brainly don't cost money but usually there is a way to pay and get better quality or cooler things.

8 0
4 years ago
Technician A says that automotive engine blocks are usually classified by the number of cylinders the block. Technician B says t
viva [34]
<span>A. Both Technicians A and B is the answer</span>
8 0
3 years ago
Americans overwhelmingly support organ and tissue donation.
Simora [160]

This statement would be TRUE


7 0
4 years ago
If a form-based code is administered, then what does the administration section of the code specifically set forth?
Mamont248 [21]

Answer:

Form-based codes have a description of what uses a building or a place is permitted but focus on the physical character of construction, particularly how they relate to the public realm shared by everybody. More and more people across the country and around our world have seen form-based codes as a more effective and efficient method to accomplish what they want, protect what they care about and escape what they do not want.

Explanation:

In the 1980s a group of architects and designers were trying to construct an alternative to traditional zoning, focusing less on use and more on size, construction speed, the shape of public spaces and the connections between buildings. Throughout this time the Duany Plater-Zyberk & company was planned to create a new community based on traditional neighborhood design concepts, Seaside, Florida, which originally developed an earlier modern type code to direct the development of the new community. The entire municipal code of Seaside was graphically illustrated on one poster as a radical deviation from traditional zoning.

6 0
3 years ago
Other questions:
  • 0.005098 megaliters to liters. Show your work.
    11·1 answer
  • The essence of strategy is ____, so competitive advantage is often gained when an organization tries a strategy that no one has
    15·1 answer
  • How is typing speed measured
    12·2 answers
  • Please help me please
    6·1 answer
  • How does this app work?
    11·2 answers
  • A program is run line by line to determine the source of a logic error. Which best describes the specific tool being used?
    11·2 answers
  • Make a list of five primary raw materials, for each one, indicate and industrial material that is created from it
    10·2 answers
  • What are the characteristics of the sorting and grouping options in Outlook? Check all that apply. Columns can be sorted by clic
    15·2 answers
  • How do you open an application on the macOS?
    11·2 answers
  • The Internet is based on a U.S. government project called ________. Today, the Internet is a collection of networks, tied togeth
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!