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

Algo Midterm

This document outlines the mid-term exam details for the Analysis of Algorithms course at the University of Management and Technology, including instructions, exam structure, and specific questions. The exam consists of four questions, covering topics such as time complexity analysis, asymptotic notations, and the Master Theorem. Strict rules regarding academic integrity and the use of electronic devices are emphasized.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views6 pages

Algo Midterm

This document outlines the mid-term exam details for the Analysis of Algorithms course at the University of Management and Technology, including instructions, exam structure, and specific questions. The exam consists of four questions, covering topics such as time complexity analysis, asymptotic notations, and the Master Theorem. Strict rules regarding academic integrity and the use of electronic devices are emphasized.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

University of Management and Technology

Mid Term Exam (Fall-2024 Semester)


Department of Computer Sciences
Program/Semester: BSCS
Course Code: CS3044
Resource Person: Usman Ul Haq Course Title: Analysis of Algorithms
Exam Date: 12-12-2024 Section: _______________________
Time Allowed 60 Minutes Total Marks: 25

Name:_____________________________ ID:______________________________

Instructions:
• Do Not Start the Paper until asked to do so.
• Attempt all Questions.
• Understanding the question paper is also part of the exam. Make suitable ASSUMPTIONS.
• Solve all the questions on the provided answer sheet.
• Be sure to read questions carefully and answer all parts. Use complete sentences and explain your
answers.
• Use of mobile phones or any other electronic device/gadget is strictly prohibited. If any student is
found using a mobile phone during the examination, this would be considered a case of academic
misconduct and treated as a UMC offence. Cell Phones should be turned off.
• Leave your books/notes or any kind of helping material at the front of the examination room.
• Any kind of cheat sheet if found will result in immediate disqualification from the Exam and F as
the final grade in your course.

Q.no1 (CLO1)= 5 Q.no.2 (CLO1)= 5 Q.no.3(CLO2) =10 Q.no.4 (CLO2)= 5 Total =25

Reviewed By: Checked By:

1
Question 01: [CLO 1] 3+2=5
i. Analyze the worst-case Time Complexity of the following piece of code by any
means that you have studied.

void myFunction(int n)
{
for (int i = 0; i < n; ++i) {
cout << i << " "; }

int main() {

int n = 10;

for (int i = 0; i < n; ++i) {

if (i < 0) {

myFunction(i);

} return 0; }

ii. Write the algorithm to find the greatest common divisor

2
Question 02: [CLO1] 2.5x2=5
i. What are asymptotic notations. Write some of their properties.

ii. Write all the scenarios when the recurrence equation cannot be solved using the
master theorem.

3
Question 03: [CLO2] 5+5=10
Compute the Worst time complexity of the following using Master Theorem.
i. T(n)= 9T(n/3) +n2

4
ii. T(n)= 4T(n/2)+ n/(logn)2

5
Question 04: [CLO2] 5
Solve by Recursion tree method to find Big O.

You might also like