0% found this document useful (0 votes)
5 views3 pages

Fall 2024_CS502_2

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 3

Assignment No.

02
Fall 2024 Total Marks: 15
CS502- Fundamentals of Algorithms

Due Date: 21-Nov-2024

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:
 The assignment is submitted after due date.
 The submitted assignment is other than MS Word file.
 The submitted assignment does NOT open or file is corrupted.
 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 one .doc/docx file.

Lectures:

 Lectures 6 to 12 are covered in this assignment.

Objectives

 The objectives of this assignment are;

 To give basic knowledge and understanding of merge sort algorithm.


 To give basic knowledge and understanding of heap sort algorithm.

For any query about the assignment, contact at CS502@vu.edu.pk

Question No. 1:
Following is the tree diagram of max heap. You have to perform the insert operation on the given tree. You are
required to insert node 35 in the given heap tree, apply heapify procedure and then show only the final max
heap tree. No need to show the intermediate steps.

Question 2:
Given below is an unsorted array. You are required to sort the following given array step by step, using Merge
Sort (ascending order). You are required to correctly fill the empty cells given below using the divide and conquer
strategy of merge sort algorithm.

38 27 43 3

? ?
? ?

? ? ?
?

? ? ? ?
? ? ? ?

Good Luck!

Total Marks: 15

You might also like