# data structure and algorithms

1. Heaps.

(a) What are the minimum and maximum number of elements in a heap of height h?

(b) Show that an n-element heap has height blog nc.

(c) Show that in any subtree of a max-heap, the root of the subtree contains the largest value occurring

anywhere in that subtree.

(d) Is the sequence h23; 17; 14; 6; 13; 10; 1; 5; 7; 12i a max-heap? Why or why not?

2. Heaps.

(a) Illustrate the operation of Max-Heapify(A; 3) on the array A = h27; 17; 3; 16; 13; 10; 1; 5; 7; 12; 4; 8; 9; 10i.

(b) Illustrate the operation of Build-Max-Heap(A) on the array A = h5; 3; 17; 10; 84; 19; 6; 22; 9i.

(c) You are given a list of numbers for which you need to construct a min-heap. How would you use

an algorithm for constructing a max-heap to construct a min-heap?

3. Heapsort.

Argue the correctness of Heapsort using the following loop invariant.

At the start of each iteration of the for loop, the subarray A[1 : : : i] is a max-heap containing

the i smallest elements of A[1 : : : n], and the subarray A[i+1 : : : n] contains the n

Taidot: Algoritmi, Tietokantaohjelmointi

Tietoa työnantajasta:
( 121 arvostelua ) Calcutta, India

Projektin tunnus: #8655689

## 10 freelanceria on tarjonnut keskimäärin %project_bid_stats_avg_sub_18% %project_currencyDetails_sign_sub_19%/tunti tähän työhön

hello i am a PhD in computer science and engineering. i can do this algorithm task perfectly. i can give you a sample solution(message me for that). thanks

₹277 INR / tunti
(10 arvostelua)
4.1
SharjeelSohail

A proposal has not yet been provided

₹100 INR / tunti
(28 arvostelua)
3.8
crazynightwalker

A proposal has not yet been provided

₹400 INR / tunti
(9 arvostelua)
3.3
bsse2059

HI sir ...? I will provide exact and to the point answer to those question. I have sound knowledge about data structure and specially heep. I will also provide code for those question. I know heap very good and also p Lisää

₹277 INR / tunti
(0 arvostelua)
0.0
YashGupta1

A proposal has not yet been provided

₹277 INR / tunti
(0 arvostelua)
0.0
kumarabhishek05

i am Computer Science Student. just studied Data structures. good knowledge of all the data structures.

₹220 INR / tunti
(0 arvostelua)
0.0
acanubhav

i have already solved all. I shall directly mail it to you. i have published research papers on sorting algorithms.

₹222 INR / tunti
(0 arvostelua)
0.0
abhilash295

I have studied data structures and algorithm as a subject for my under graduate. I am very familiar with the concepts of min and max heap data structures. I can provide a clear descriptive answer to the questions menti Lisää

₹222 INR / tunti
(0 arvostelua)
0.0
khannanav

My team of expert programmers would be more than happy to work on this project. Please give us a chance and I assure of the best quality work. Regards Naveen

₹222 INR / tunti
(0 arvostelua)
0.0
prateekneha

I am good with data structures and algorithms and I am able to solve all the questions listed in the project description. 1. [assume height of root node is 0] minimum elements: 2^h; Maximum elements: 2^(h+1)-1 2. Pr Lisää

₹277 INR / tunti
(0 arvostelua)
0.0
rohitangira

i have good knowledge of data structure and algorithms.. [login to view URL] at 565 th rank in codechef long challenge october(user name: rohitangira) [login to view URL] codevita first round --265 th second round---30th (tcs Lisää

₹277 INR / tunti
(0 arvostelua)
0.0