You are on page 1of 28

Pir Mehr Ali Shah

Arid Agriculture University, Rawalpindi


Office of the controller of Examinations
Final Exam / Spring 2020 (Paper Duration 48 hours)
To be filled by Teacher

Course No.: CS542…………Course Title:……………………Analysis of Algorithm…………………………………………


Total Marks:……….……30……………Date of Exam: 10/08/2020
Degree: ……………BSCS………………. Semester:…………4 th………… Section: A
Marks
Q.No. 1 2 3 4 5 6 7 8 9 10 Obtained/
Total Marks
Marks
Obtaine
d
Total Marks in Words:
Name of the teacher: GHULAM MUJTABA
Who taught the course: GHULAM MUJTABA Signature of teacher / Examiner:

To be filled by Student

Registration No.: 18-ARID-6329……………………………………… Name: Muhammad Mubasher Khan


……………………………………………………..

Answer the following questions.

Q.No.1. Solve by using following array by quick sort algorithm and show steps.
85 24 63 45 12 31 96 50
(Marks….10)
Answer:
Q.No.2.(a) List the nodes of the tree below in preorder, postorder, and breadth-first
order.
(Marks….6)

Answer:
Q.No.2.(b) In
the binary search tree below, carry out the following operations in
sequence: Add 5, add 17, delete 23, delete 9. (Marks….4)
Answer:
Q.No.3. (a) Conduct DFS for the following graph.

(5 marks)

Answer
(b) Apply DFS based algorithm to solve topological sorting problem for the following
graph:
 

(Marks………5)
Answer:

You might also like