Professional Documents
Culture Documents
Institute of Southern Punjab Multan
Institute of Southern Punjab Multan
Multan
Department of Computer Science & IT
MID Term Examination
Subject: Design and Analysis of Algorithm
Class: BSCS 6th A, BSCS 6th B, Semester: 1th
BSCS 6th C
Instructor: Waqas Sharif Date: 13-06-2019
Paper Type: Objective Time 10 minutes
Allowed:
Instructions: (Read Carefully)
Read Question Paper carefully. Don’t write anything on the Question Paper except your Registration No and Name.
Question paper is a closed book. Make sure your mobile phone is switched off. Any unauthorized material found
after examination starts will be regarded as possible evidence of cheating or attempting to do so. Avoid cutting /
overwriting.
1. The time factor when determining the efficiency of algorithm is measure by counting
a) microseconds b) key operations c) statements d) bytes of algorithm
2. Which case analysis appropriate when the response time of the algorithm is critical?
a) worst b) best c) average d) all are equal
3. The sorting technique based on divide and conquer
a) bubble b) merge c) insertion d) shell
4. Time complexity of merge sort
a) O(1) b) O(n2) c) O(n) d) O(nlogn)
5. The concept of order Big O is important because
a) It can be used to decide the best algorithm that solves a given problem
b) It determines the max size of a problem that can be solved in a given amount of time
c) It is the lower bound of the growth rate of algorithm
d) both a & b
6. On which algorithm is heap sort based on?
a) divide and conquer b) binary search tree c) priority queue d) arrays
7. If several elements are competing for the same bucket in the hash table, what is it called?
a) diffusion b) replication c) chaining d) collision
8. The way a card game player arranges his cards as he picks them one by one can be
compared to
a) insertion sort b) merge sort c) quick sort d) bubble sort
9. In binary tree sort, we first construct the BST and then we perform _ traversal to
get the sorted order.
Design an algorithm for insertion sort and calculate the time complexity of algorithm in the form of growth
rate order, also discuss the best and worst case of the algorithm (8)