0% found this document useful (0 votes)
111 views2 pages

CSC 308 Exam 2024

Uploaded by

sirajobakura
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
111 views2 pages

CSC 308 Exam 2024

Uploaded by

sirajobakura
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

FEDERAL UNIVERSITY BIRNIN KEBBI

DEPARTMENT OF COMPUTER SCIENCE


SECOND SEMESTER EXAMINATION
2023/2024 ACADEMIC SESSION
COURSE: CSC 308 (ALGORITHMS AND COMPLEXITY ANALYSIS)
ANSWER ANY FOUR (4) QUESTIONS TIME ALLOWED: 21/2 HOURS

1a. Differentiate between Merge sort and Burble sort algorithms with the reference to their
time complexity. [7 Marks]
1b. Calculate the running time for the algorithm below
do until the pointers low and high meet each other.
mid = (low + high)/2
if (x == arr[mid])
return mid
else if (x > arr[mid]) // x is on the right side
low = mid + 1
else
high = mid – 1 [8 Marks]

2a. Write short note on any two of the following operations on a graph
i. BFS
ii. Walk
iii. DFS [ 6 Marks]
2b. With the help of the simplifying rules of asymptotic analysis, evaluate the running time of the
following functions
a. f(n) = 3n4 +4000n2 - 500n +45.
b. f(n) = nlog200 + 200! + xn
c. =n+ [9 Marks]

3a. With the help of an example, differentiate between P and NP problems [5 Marks]
3b. What is the practical advantage to knowing that a problem is NP-complete. [5 Marks]
3c. Discuss on Complexity Analysis [5 Marks]

4a. Complete the table below


Algorithm DFS Linear Burble Sort Hash Insertion Binary
Search Table Search Search
Running
time(worst case)
[6 Marks]
4b.Write a closed-form solution for each of the following summations:

a. b. c. [6 Marks]

4c. What is a Decision Problem [3 Marks]

Page 1 of 2
5a. Generate an Adjacency matrix and Adjacency List for the Graph below [8 Marks]

5b. Itemize four (4) examples each for P and NP problems. [7 Marks]

6a. Define a Graph [5 Marks]


6b. Enumerate four (4) factors used to measure the cost of an Algorithm and explain any Two. [5 Marks]
6c. Shed more light on any two of the following with regards to complexity analysis
i. Best case
ii. Worst case
iii. Average case [5 Marks]

Page 2 of 2

You might also like