www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

www.vustudents.ning.com

# ASSIGNMENT 2 CS502 fundamental alogrithm DUE DATE 4 JUNE

ASSIGNMENT 2
Please view the assignment submission process document provided to you by the Virtual University to upload the assignment. And submit your solution as Microsoft word file.
Rules for Marking
It should be clear that your assignment will not get any credit if:
oThe assignment is submitted after due date.
oThe submitted assignment does not open or run.
oThe assignment is copied
Problem #1: 10 marks
Recall BuildHeap (1,n) that builds a heap of n-elements from an array:
for i = n/2 downto 1 do
bubble_down(i);
For the array drawn below, fill the boxes for each iteration of BuildHeap(1,10).
Assume that the root of the heap holds the maximum element.
15
20
8
56
2
38
36
26
28
7
Problem #2: 5 marks
Arrange the following in the Most to Least complexity order.
210000023232log1000000000000000100000000000000log*log1000000000000log*!log**1000000000000000

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

Views: 19408

Attachments:

### Replies to This Discussion

how it possible

It'll be helpful for understanding and solving 1st Qstn...IN SHAA ALLAH !!

Attachments:

Yah this is helpful for heapSort Algorithm but not for BuildHeap...

It tried as per my concepts if any conspiracy kindly reply here.

Attachments:

brother total itration kitni krni hain or 2nd q. ka kuch bata dain kindly

1

2

3

4

5

## Latest Activity

11 minutes ago
11 minutes ago
12 minutes ago
+ M.Tariq Malik added a discussion to the group MCM101 Introduction to Mass Communication

### MCM101 Introduction to Mass Communication GDB Fall 2020 Solution / Discussion

12 minutes ago
"#mcm101 gdb solution fall 2021 https://youtu.be/QVOxRyzxpE4"
17 minutes ago
21 minutes ago
21 minutes ago
+ M.Tariq Malik added a discussion to the group MGT404 Managerial Accounting

### MGT404 Managerial Accounting Assignment Fall 2020 Solution / Discussion

22 minutes ago
24 minutes ago
+ M.Tariq Malik posted a discussion

25 minutes ago
26 minutes ago
30 minutes ago