Algorithm: MCQ Set – 01
Q1: What is the time complexity of insertion sort in best case?
- (A) O(n)
- (B) O(n2)
- (C) O(nlog2n)
- (D) O(log2n)
Q2: The time factor when determining the efficiency of algorithm is measured by
- (A) Counting microseconds
- (B) Counting the number of key operations
- (C) Counting the number of statements
- (D) Counting the kilobytes of algorithm
Q3: Which of the following algorithm design technique is used in the quick sort algorithm?
- (A) Dynamic programming
- (B) Backtracking
- (C) Divide and conquer
- (D) Greedy method
Q4: For the Quick sort algorithm, what is the time complexity of the best/worst case?
- (A) best case: O(log(n)) worst case: O(n2)
- (B) best case: O(n2), worst case: O(n log(n))
- (C) best case: O(n log(n) ) worst case: O(n2)
- (D) best case: O(n2), worst case: O(n2log(n) )
Q5: Binary Search Method has Worst Case Time Complexity of
- (A) 2n
- (B) nlog(n)
- (C) log(n)
- (D) n*n
Q6: The average case complexity of Insertion Sort is
- (A) O(2n)
- (B) O(n2)
- (C) O(n3)
- (D) O(2n)
Q7: An hash table with chaining as a collision resolution technique degenerates to a
- (A) Stack
- (B) Queue
- (C) Linked List
- (D) Tree
Q8: Assume the input array is nearly sorted. Then performance of Quick sort is
- (A) Better than Average case
- (B) Worst than Average case
- (C) Same as in Average case
- (D) None of these
Q9: A technique for direct search is
- (A) Binary Search
- (B) Linear Search
- (C) Tree Search
- (D) Hashing
Q10: The running time T(n) is given as
T(n) = c + T(n-1) , if n >1
= d , if n<=1
The order of the algorithm is
- (A) n2
- (B) n
- (C) n3
- (D) nn
Answer:
Question | Q1 | Q2 | Q3 | Q4 | Q5 | Q6 | Q7 | Q8 | Q9 | Q10 |
Answer | A | B | C | C | C | B | C | B | D | B |