University of Sargodha, Lahore Campus
Mid Term Examinations
Program BSCS Semester 4th Section
Name Design and Analysis of Instructo Mr. Zeeshan, Time allowed 15 minutes
Algorithms r Ms. Eisha
Roll No Date Total Marks 12 marks
Objective Part
1. Every question below has some choices. Tick the correct one. 8 marks
1. Two main measures for the efficiency of an algorithm are
a. Processor and memory
b. Complexity and capacity
c. Time and space
d. Data and space
2. Which of the following data structure is not linear data structure?
a. Arrays
b. Linked lists
c. Both of above
d. None of above
3. Which of the following is not an in-place algorithm?
a. Selection sort
b. Heap sort
c. Quick sort
d. Merge sort
4. The complexity of the average case of an algorithm is
a. Much more complicated to analyze than that of worst case
b. Much simpler to analyze than that of worst case
c. Sometimes more complicated and some other times simpler than that of worst
case
d. None or above
5. Which of the following case does not exist in complexity theory :
a. Best Case
b. Worst Case
c. Average Case
d. Null Case
6. The complexity of bubble sort algorithm:
University of Sargodha, Lahore Campus
Mid Term Examinations
a. O(n)
b. O(log n)
c. O(n2)
d. O(n log n)
7. The term “push” and “pop” is related to the:
a. array
b. lists
c. stacks
d. all of the above
8. The complexity of Binary search algorithm is
a. O(n)
b. O(log n)
c. O(n2)
d. O(n log n)
9. which of the following is not the method for solving complexity of recursive problem:
a. Substitution method
b. Recurrence tree method
c. Master Theorem
d. none of these
10. From Asymptotic notions Theta notation is known as:
a. Worst Case
b. average case
c. Best case
d. none of these
11. How many types of sorting exist:
a. Two
b. Three
c. Four
d. Five
n
12. Time Complexity of T(n) = 4T ( 2 ¿ + n2 will be:
a. O(n2 log n)
b. O(n2 )
University of Sargodha, Lahore Campus
Mid Term Examinations
c. O(n log n)
d. O(n)