Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

COMSATS University Islamabad, Vehari Campus

Department of Computer Science


First Sessional Examination – Fall 2020
Subject: Design & Analysis of Algorithms Instructor: Uzair Ishtiaq
Class: BCS-B17 Total Time: 60 Minutes
Maximum Marks: 10 Registration Number:___

NOTE: Attempt all questions.


Understanding the question paper is a part of your exam.
Sharing anything during the examination is strictly prohibited.
Attach the question paper with your answerbook before leaving the exam hall.

Question 01: Write an algorithm to find the Greatest Common Divisor (GCD) using Euclid’s
Algorithm. Also, find the GCD of x, y and z (where x = 203, y = 91 and z = 77) using Euclid’s
Algorithm. Analyze your algorithm and find its time complexity. [5]

Question 02: How are the Upper, Lower and Tight Bounds on a function are represented
mathematically and graphically? Also describe the behavior of a function in the case of
Logarithmic, Linear, Quadratic, Cubic and Exponential expressions. [5]

“Think before you speak. Read before you think.”


― Fran Lebowitz

You might also like