api.ning.comapi.ning.com/files/yxutb-i6x1ccmzon3rko58a6xpes9iyyyxybj... · web viewto make you...

3
Assignment No. 4 SEMESTER Spring 2015 CS301- Data Structures Total Marks: 20 Due Date: 04-08- 2015 Instructions Please read the following instructions carefully before solving & submitting assignment: It should be clear that your assignment will not get any credit (zero marks) if: o The assignment is submitted after due date. o The submitted assignment is other than MS Word (.doc) file. o The submitted assignment does NOT open or file is corrupted. o The assignment is copied (from other student or ditto copy from handouts or internet). Uploading instructions For clarity and simplicity, You are required to Upload/Submit only .doc/.docx file. Objective The objective of this assignment is, o To make you familiar with construction of Heap Data Structure. For any query about the assignment, contact at [email protected] GOOD LUCK Assignment Statement: Marks: 20 Consider the following Max Heap and its array representation:

Upload: duongphuc

Post on 15-Mar-2018

215 views

Category:

Documents


1 download

TRANSCRIPT

Assignment No. 4

SEMESTER Spring 2015

CS301- Data Structures

Total Marks: 20

Due Date: 04-08-2015

Instructions

Please read the following instructions carefully before solving & submitting assignment:

It should be clear that your assignment will not get any credit (zero marks) if:o The assignment is submitted after due date.o The submitted assignment is other than MS Word (.doc) file.o The submitted assignment does NOT open or file is corrupted.o The assignment is copied (from other student or ditto copy from handouts or internet).

Uploading instructions

For clarity and simplicity, You are required to Upload/Submit only .doc/.docx file.

Objective

The objective of this assignment is,

o To make you familiar with construction of Heap Data Structure.

For any query about the assignment, contact at [email protected] LUCK

Assignment Statement: Marks: 20

Consider the following Max Heap and its array representation:

Default method to build heap takes O (N lg N) time in its worst case. However, build Heap operation can be made optimal and performed in linear time (O (N)) by applying a percolateDown method to nodes.

You are required to convert the given max heap into min heap using percolateDown method. Show first ten steps one by one.

Solution Guidelines: 1. First understand min heap, max heap and its array representation from handouts and lectures. 2. Understand working of PercolateDown method using example given in handouts. 3. Convert the given max heap into min heap. 4. Show and explain first 10 steps of conversion, skip remaining steps and then show the final min heap after conversion.

Lectures Covered: This assignment covers Lecture 29-32.Deadline: Your assignment must be uploaded/submitted at or before August 4, 2015.