Algorithm MCQs:-
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
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
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
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
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)
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
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)
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
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)
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
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)
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
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)
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)
Similar posts:-
- C-programming MCQs part-1
- C-programming MCQs part-2
- C-programming MCQs part-3
- C-programming MCQs part-4
- C-programming MCQs part-5
- C-programming MCQs part-6
- COA MCQs part-1
- COA MCQs part-2
- COA MCQs part-3
- COA MCQs part-4
Must check this :-
- Microprocessor 8085 MCQs part-1
- Microprocessor 8085 MCQs part-2
- Microprocessor 8085 MCQs part-3
- CSS MCQs part-1
- CSS MCQs part-2
- CSS MCQs part-3
- CSS MCQs part-4
- CSS MCQs part-5
- Engineering Mathematics -II MCQs part-1
- Engineering Mathematics -II MCQs part-2
- Engineering Mathematics -II MCQs part-3
- Engineering Mathematics -II MCQs part-4
- Engineering Mathematics -II MCQs part-5
- Operating system MCQs part-1
- Operating system MCQs part-2
- Operating system MCQs part-3
- Operating system MCQs part-4
- Operating system MCQs part-5
0 Comments