Find running time of heap sort input sorted-ascending order

Assignment Help Data Structure & Algorithms
Reference no: EM1386474

HEAPSORT( array A, int n)

1 BUILD-HEAP(A, n)
2 m n
3 while (m  2)
4 do SWAP(A[1],A[m])
5 m m- 1
6 HEAPIFY(A, 1,m)

Let the pseudo code of Heap Sort reply following questions (you need to justify your answers as well),

a. Determine the running time of Heap Sort if input is sorted in ascending order

b. Determine the running time of Heap Sort if input is sorted in descending order

c. What is best case input (format of input resulting in best case time) for Heap Sort.

 

Reference no: EM1386474

Questions Cloud

Antisense technique to prevent allergen gene : Genetically modified almonds to be come allergen-free. What is the step by step mechanism of how to use antisense technique to prevent allergen gene from being express?
What is the enhancement in temperature of bullet : A flight attendant pulls her 63-N flight bag a distance of 277-m along a level airport floor at a constant velocity. The force she exerts is 35N at an angle of 57° above the horizontal. Determine the work completed by the force of friction on flig..
How many cars would you expect to see in the system : How many cars would you expect to see in the system. A toll tunnel has decided to experiment with the use of a debit card for the collection of tolls. Initially, only one lane will be used
What torque is required to the motor : A 24.00 kg child is on a swing that hangs from 1.6-m long chains. What is her highest speed if she swings out to a 45° angle.
Find running time of heap sort input sorted-ascending order : Determine the running time of Heap Sort if input is sorted in ascending order. Determine the running time of Heap Sort if input is sorted in descending order.
Formulate a spreadsheet model that will give the profit : Formulate a spreadsheet model that will give the profit in part b for any of the two numbers. Use the Excel goal seek command to calculate the break-even point found in part a.
Question about molecular biology : Assume you infected an E. coli culture with a virulent bacteriophage. Most of the cells lysed, but a few survived - 1x10^-4. You wonder where the resistant bacteria came from.
Determine the amount by which the spring is stretched : A 9.10 kg board is wedged into a corner and held by a spring at a 50° angle, as the Illustrating shows. The spring has a spring constant of 196 N/m and is parallel to the floor.
Determine the mode shapes and frequencies of vibration : Determine the mode shapes and frequencies of vibration of the system of cars by Sweeping the rigid body mode

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Portfolio planning using optimization

Set this problem up as a linear programming model in Excel, and use Solver to determine how the $10 million should be invested. What is the overall return (in dollars terms)

  Design time randomized monte carlo algorithm

You have to design an O(n) time randomized Monte Carlo algorithm which computes an (1 + o)- approximate ham-sandwich cut with probability 1 - n-c for any given constant c > 0.

  Explain feasibility analysis for jobs of lrt algorithm

Study feasibility analysis for jobs of LRT algorithm when preemption is allowed. Which scheduling algorithm is best suited for high speed networks and why? Distinguish between static and dynamic systems.

  How output of leaky bucket policer can be fed in second

Illustrate how output of the leaky bucket policer can be fed into second leaky bucket policer so that two leaky buckets in series police average rate, peak rate, and burst size.

  Define wan and provide an example of typical wan setup

Define a WAN and provide an example of a typical WAN setup and describe the components. Provide a picture, chart, or image if possible.

  Explaining diffie-hellman public-key algorithm

Use the Diffie-Hellman public-key algorithm to exchange secret keys.

  Question about communication recovery plan

Think about a natural or man made disaster, and explain how a communications network could be recovered from such a disaster.

  Different network connections

Use your laptop at public store to check your email and discuss all the different network connections involved in this operation.

  Create efficient algorithm to find path in graph

Given connected undirected graph G described by the adjacency list representation create the efficient algorithm to find the path in G which goes through exactly once in each direction.

  List of common data structures

Make a list of some of the common data structures provided by C#. You should have a minimum of 4 different data types.

  Data structures assignment requiring c++ program

You should build enough new roads such that if City A was reachable from City B via some old roads, City A must be reachable from City B via some new roads.

  Write algorithm to create job applicant report

Write the algorithm to create job applicant report. Input consists of a series of records that contain the Social Security number or equivalent, last name, first name, middle initial.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd