Data Structure & Algorithm Mid Exam weight = 20%
Name: ___________________________________________ IDNo _______________________
I. Choose the Best Answer
1. Each instruction must be clear and unambiguous. This statement indicates which
properties of algorithm? A. Input B. Feasibility C. Finiteness D. Definiteness
2. What is the time complexity of f(x) = 3x3 +9x+6?
A. 9x B. 3x3 C. x3 D. 3x3 +9x+6
3. Which one is odd among the following data structure?
A. Tree B. Array C. Linked List D. Stack
4. The maximum number of comparison in sequential searching is _______
A. O (n/2) O(1) C. O(n) D. None
5. Binary search can works with unordered list. A. True B. False
6. In which type of sorting either largest or the smallest number is pushed to its proper
place? A. Bubble B. Insertion C. Selection D. All
II. Give the short Answer
1. What is the time complexity of the following code? if the value of n is 25
int total(int n) {
int sum=0;
for (int i=1;i<=n;i++)
sum=sum+1;
return sum; }
2. List at least four characteristics of an algorithm and explain them
3. Define the term data structure and algorithm.
4. What are the two approaches to measure the efficiency of algorithms?