0% found this document useful (0 votes)
64 views3 pages

CSC 210 (Exam) 2019-2020 BATCH (B)

This document contains instructions for a Computer Science examination on algorithm and complexity analysis. It lists 5 questions, with sub-questions on various topics related to algorithms including: 1) Types of algorithms, linear probing in hashing, characteristics of algorithms. 2) Advantages of sequential search, quicksort implementation, graph data structure representations. 3) Differences between mini-heap and max-heap, complexity definition, hash table operations, memory usage reasons. Students are required to answer question 1 and any other two questions. The questions assess understanding of algorithmic concepts such as complexity classes, data structures, and specific algorithms.

Uploaded by

seyi
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)
64 views3 pages

CSC 210 (Exam) 2019-2020 BATCH (B)

This document contains instructions for a Computer Science examination on algorithm and complexity analysis. It lists 5 questions, with sub-questions on various topics related to algorithms including: 1) Types of algorithms, linear probing in hashing, characteristics of algorithms. 2) Advantages of sequential search, quicksort implementation, graph data structure representations. 3) Differences between mini-heap and max-heap, complexity definition, hash table operations, memory usage reasons. Students are required to answer question 1 and any other two questions. The questions assess understanding of algorithmic concepts such as complexity classes, data structures, and specific algorithms.

Uploaded by

seyi
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/ 3

KOLADAISI UNIVERSITY, IBADAN

Faculty of Applied Sciences


Department of Mathematical and Computing Sciences
Second Semester Examination 2019/2020 Session (Make-Up)

CSC 210: Algorithm and Complexity Analysis (3 Units) Time: 3 hours


INSTRUCTION: Answer question 1 and ANY other two questions

1. (a) Mention any five types of an algorithm (5mks)


(b) Write the missing line for the following program (5mks)
int count = 0
……………………………….
for (int j =0; j<1; j++)
Count ++
(c) When is an algorithm considered to be good (5mks)
(d) What is big-oh notation in time complexity (5mks)
(e) Mention five characteristics of an algorithm (5mks)
(f) Define the term linear probing in hashing technique (5mks)

2. (a) Highlight four advantages of sequential search algorithm (4mks)


(b) Complete the following quick sort implementation (5mks)
def partition(arr,low,high):
i = ( low-1 ) # index of smaller element
pivot = arr[high] # pivot
for j in range(low , high):
# If current element is smaller than or
# equal to pivot
if arr[j] <= pivot:
# increment index of smaller element
i = i+1
(……………………………………………)

arr[i+1],arr[high] = arr[high],arr[i+1]
(………………………………………)

(c) Explain briefly two representations of graph data structure (5mks)


(d) Give the worst case time, average case time and best case time complexity of heap Sort (6mks)
3. (a) Differentiate between mini-Heap and max-Heap in binary search tree (BST) (5mks)
(b) Define the term complexity of an algorithm (5mks)
(c) Explain the three basic primary operations involved in hash table (6mks)
(d) Highlight the two reasons for memory usage during execution of algorithm (4mks)

4. (a) Draw the adjacency matrix for the directed graph given below (5mks)

(b) List the five steps involved in complete running time of an algorithm (5mks)
(c) Explain how the following operations work in binary search tree (BST) (4mks)
(i) Insertion in BST (ii) Deletion in BST
(d) Discuss the two measures used in algorithm complexity (6mks)

5. (a) Complete the table below (4mks)

Type Size
bool, char, unsigned char, signed char, __int8
__int16, short, unsigned short, wchar_t, __wchar_t
float, __int32, int, unsigned int, long, unsigned long
double, __int64, long double, long long

(b) What is sorting algorithm? (5mks)


(c) State the two properties of asymptotic notations (5mks)
(d) Compute the space complexity for the following expression. (6mks)
{
int z = a + b + c;
Return(z);
}

You might also like