You are on page 1of 1

INTERNATIONAL ISLAMIC UNIVERSITY ISLAMABAD

DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING (F.C)

Midterm Examination Spring 2019


__________________________________________________________________________________
Course Title: Advance Analysis of Algorithms Exam Date: 04-04-2019
Course Code: CS-231 Total Marks: 40
Class: BS-MISC Time Allowed: 1.5 hours
Section: Weight-age of the Paper: 20 %
Instructor: Asim Sharif Satti

Instructions:
Q1. Give short answers to all these questions. (15 Marks)
(a) What we mean by asymptotic complexity PART A do we compare algorithms?
and how
(b) Define different types of asymptotic notations.
(c) Proof that a complete binary tree with N nodes has height of O(logN).
(d) What is a Left-justified binary tree?
(e) Write the names of all shortest path algorithms and their complexity.

Q2. Given below is a weighted graph. (7.5+7.5 = 15 Marks)

(a) Give Adjacency Matrix and Adjacency List representation of above graph.

(b) Find the shortest path from node 1 to all other nodes using Dijkstra’s algorithm.

Q3. (a) What are the Heap procedures for sorting? Write down the complexity of Heap
procedures. (2.5 Marks)

(b) Define priority queues and the applications of priority queues. (2.5 Marks)

(c) Sort the list by heapsort using the array representation of heaps. (5 Marks)

22,17,19,21,18,15,13,9,12,7,4 (in increasing order).

Page 1 of 1

You might also like