Array Representation, Binary Trees-Data Structure-Assignment Solution, Exercises of Data Structures and Algorithms

I am student at Baddi University of Emerging Sciences and Technologies. To help my friends in other universities, I am uploading my solved assignments of different courses. Its for Data Structure course. Other can see if they are searching following: Array, Representation, Binary, Tree, Heap, Property, Data, Structures

Typology: Exercises

2011/2012

Uploaded on 08/01/2012

parmitaaaaa
parmitaaaaa ๐Ÿ‡ฎ๐Ÿ‡ณ

4.2

(111)

173 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Course๎˜ƒCode:๎˜ƒ๎˜ƒCS301๎˜ƒ(Data๎˜ƒStructures)๎˜ƒ
Assignment๎˜ƒNo.๎˜ƒ5๎˜ƒSolution:๎˜ƒ
Question๎˜ƒNo.๎˜ƒ1๎˜ƒ
The๎˜ƒarray๎˜ƒrepresentation๎˜ƒof๎˜ƒthe๎˜ƒgiven๎˜ƒMAX๎˜ƒHEAP๎˜ƒis๎˜ƒas๎˜ƒfollows,๎˜ƒ
๎˜ƒ
Question๎˜ƒNo.๎˜ƒ2๎˜ƒ
The๎˜ƒcomplete๎˜ƒBinary๎˜ƒtree๎˜ƒfor๎˜ƒthe๎˜ƒgiven๎˜ƒarray๎˜ƒwould๎˜ƒbe๎˜ƒas๎˜ƒfollows,๎˜ƒ
๎˜ƒ
As๎˜ƒthe๎˜ƒgiven๎˜ƒtree๎˜ƒis๎˜ƒnot๎˜ƒonly๎˜ƒa๎˜ƒcomplete๎˜ƒbinary๎˜ƒtree๎˜ƒbut๎˜ƒalso๎˜ƒobey๎˜ƒthe๎˜ƒheap๎˜ƒproperty,๎˜ƒso๎˜ƒit๎˜ƒis๎˜ƒalso๎˜ƒ
a๎˜ƒMIN๎˜ƒHEAP.๎˜ƒ
๎˜ƒ
docsity.com

Partial preview of the text

Download Array Representation, Binary Trees-Data Structure-Assignment Solution and more Exercises Data Structures and Algorithms in PDF only on Docsity!

Course Code: CS301 (Data Structures)

Assignment No. 5 Solution:

Question No. 1 The array representation of the given MAX HEAP is as follows, Question No. 2 The complete Binary tree for the given array would be as follows, As the given tree is not only a complete binary tree but also obey the heap property, so it is also a MIN HEAP.

docsity.com