Header Ads Widget

Algorithm multiple choice questions part-3

 Algorithm MCQs:-

  1. Which sorting algorithm has the best worst-case time complexity? a) Bubble Sort b) Selection Sort c) Insertion Sort d) Merge Sort e) Quick Sort Answer: d) Merge Sort

  2. Which sorting algorithm has the best average-case time complexity? a) Bubble Sort b) Selection Sort c) Insertion Sort d) Merge Sort e) Quick Sort Answer: e) Quick Sort

  3. Which sorting algorithm has the best best-case time complexity? a) Bubble Sort b) Selection Sort c) Insertion Sort d) Merge Sort e) Quick Sort Answer: c) Insertion Sort

  4. What is the minimum number of swaps required in Bubble Sort? a) 0 b) Θ(n) c) Θ(n2) d) O(nlgn) e) Is not in-place sorting Answer: a) 0

  5. What is the maximum number of swaps required in Bubble Sort? a) 0 b) Θ(n) c) Θ(n2) d) O(nlgn) e) Is not in-place sorting Answer: c) Θ(n2)

  6. What is the minimum number of swaps required in Selection Sort? a) 0 b) Θ(n) c) Θ(n2) d) O(nlgn) e) Is not in-place sorting Answer: a) 0

  7. What is the maximum number of swaps required in Selection Sort? a) 0 b) Θ(n) c) Θ(n2) d) O(nlgn) e) Is not in-place sorting Answer: b) Θ(n)

  8. What is the minimum number of swaps required in Insertion Sort? a) 0 b) Θ(n) c) Θ(n2) d) O(nlgn) e) Is not in-place sorting Answer: a) 0

  9. What is the maximum number of swaps required in Insertion Sort? a) 0 b) Θ(n) c) Θ(n2) d) O(nlgn) e) Is not in-place sorting Answer: c) Θ(n2)

  10. What is the minimum number of swaps required in Quick Sort? a) 0 b) Θ(n) c) Θ(n2) d) O(nlgn) e) Is not in-place sorting Answer: a) 0

  11. What is the maximum number of swaps required in Quick Sort? a) 0 b) Θ(n) c) Θ(n2) d) O(nlgn) e) Is not in-place sorting Answer: c) Θ(n2)

  12. Which sorting algorithm is not an in-place sorting algorithm? a) Bubble Sort b) Selection Sort c) Insertion Sort d) Merge Sort e) Quick Sort Answer: d) Merge Sort

  13. What is the time complexity of Linear Search in the worst case? a) Θ(n) b) Θ(n2) c) Θ(nlgn) d) O(n) e) O(logn) Answer: a) Θ(n)

  14. What is the time complexity of Linear Search in the average case? a) Θ(n) b) Θ(n2) c) Θ(nlgn) d) O(n) e) O(logn) Answer: a) Θ(n)


  Pre  ðŸ‘ˆ                                👉  Next  

Post a Comment

0 Comments