1. : What is the primary goal of sorting algorithms?
(A) To compress data
(B) To organize data in a specific order
(C) To search for elements
(D) To encrypt data
2. : Which sorting algorithm has the best average-case time complexity?
(A) Bubble Sort
(B) Quick Sort
(C) Insertion Sort
(D) Selection Sort
3. : What is the worst-case time complexity of Bubble Sort?
(A) O(n log n)
(B) O(n²)
(C) O(n)
(D) O(log n)
4. : Which sorting algorithm is based on the divide-and-conquer strategy?
(A) Selection Sort
(B) Merge Sort
(C) Insertion Sort
(D) Heap Sort
5. : In which sorting algorithm is the largest element repeatedly swapped to the end of the list?
(A) Selection Sort
(B) Insertion Sort
(C) Quick Sort
(D) Bubble Sort
6. : What is the time complexity of Merge Sort in the worst case?
(A) O(n)
(B) O(n log n)
(C) O(n²)
(D) O(log n)
7. : Which sorting algorithm is generally the fastest for large datasets?
(A) Insertion Sort
(B) Merge Sort
(C) Quick Sort
(D) Bubble Sort
8. : What is the primary disadvantage of using Selection Sort?
(A) High memory usage
(B) Poor performance on large lists
(C) Complexity of implementation
(D) It is unstable
9. : Which sorting algorithm maintains the relative order of equal elements?
(A) Quick Sort
(B) Selection Sort
(C) Merge Sort
(D) Heap Sort
10. : What is the space complexity of Merge Sort?
(A) O(1)
(B) O(n)
(C) O(n log n)
(D) O(log n)
11. : In which algorithm does the pivot element play a critical role?
(A) Bubble Sort
(B) Quick Sort
(C) Selection Sort
(D) Merge Sort
12. : Which sorting algorithm is the most efficient for nearly sorted data?
(A) Quick Sort
(B) Bubble Sort
(C) Insertion Sort
(D) Heap Sort
13. : What is the average-case time complexity of Insertion Sort?
(A) O(n log n)
(B) O(n²)
(C) O(n)
(D) O(log n)
14. : Which of the following sorting algorithms is in-place?
(A) Merge Sort
(B) Quick Sort
(C) Bubble Sort
(D) All of the above
15. : What type of sorting algorithm is Heap Sort?
(A) Comparison-based
(B) Non-comparison-based
(C) Stable
(D) Adaptive
16. : In Quick Sort, what is the role of the pivot?
(A) To partition the array
(B) To sort the array
(C) To merge two arrays
(D) To perform linear searches
17. : What is the best-case time complexity of Insertion Sort?
(A) O(n²)
(B) O(n log n)
(C) O(n)
(D) O(log n)
18. : Which sorting algorithm is characterized by dividing the array into subarrays and sorting them independently?
(A) Quick Sort
(B) Merge Sort
(C) Bubble Sort
(D) Selection Sort
19. : What is the primary advantage of Heap Sort?
(A) It is stable
(B) It uses less memory
(C) It is an in-place algorithm
(D) It is easy to implement
20. : Which algorithm is not a comparison-based sorting algorithm?
(A) Radix Sort
(B) Quick Sort
(C) Merge Sort
(D) Bubble Sort
21. : In which scenario is Selection Sort most efficient?
(A) When the dataset is small
(B) When the dataset is large
(C) When the dataset is mostly sorted
(D) When the dataset contains many duplicates
22. : What is the worst-case time complexity of Quick Sort?
(A) O(n log n)
(B) O(n²)
(C) O(n)
(D) O(log n)
23. : Which sorting algorithm is known for its simplicity and ease of implementation?
(A) Merge Sort
(B) Quick Sort
(C) Bubble Sort
(D) Heap Sort
24. : What is the time complexity of Counting Sort?
(A) O(n²)
(B) O(n log n)
(C) O(n)
(D) O(log n)
25. : Which algorithm is not stable?
(A) Insertion Sort
(B) Merge Sort
(C) Quick Sort
(D) Bubble Sort
26. : What is the main disadvantage of Bubble Sort?
(A) It is difficult to implement
(B) It has a high time complexity
(C) It requires extra memory
(D) It is not stable
27. : What type of data does Radix Sort operate on?
(A) Integer data
(B) Character data
(C) Floating-point data
(D) All of the above
28. : Which sorting algorithm divides the data into buckets and sorts them individually?
(A) Radix Sort
(B) Merge Sort
(C) Heap Sort
(D) Quick Sort
29. : In which sorting algorithm is the data divided into halves recursively?
(A) Insertion Sort
(B) Quick Sort
(C) Merge Sort
(D) Selection Sort
30. : What is the key advantage of Merge Sort over Quick Sort?
(A) Faster execution time
(B) Lower space complexity
(C) It is always stable
(D) It has a better average-case performance
31. : Which sorting algorithm repeatedly selects the smallest element from an unsorted portion?
(A) Bubble Sort
(B) Insertion Sort
(C) Selection Sort
(D) Quick Sort
32. : What is the time complexity of Shell Sort?
(A) O(n log n)
(B) O(n²)
(C) O(n^(3/2))
(D) O(log n)
33. : Which of the following is a characteristic of Heap Sort?
(A) It is not an in-place algorithm
(B) It is stable
(C) It uses a binary heap data structure
(D) It is based on the divide-and-conquer strategy
34. : What is the primary purpose of the partitioning step in Quick Sort?
(A) To combine sorted arrays
(B) To rearrange elements around a pivot
(C) To select the next pivot
(D) To merge two halves
35. : Which of the following algorithms has a time complexity of O(n²) in the worst case?
(A) Merge Sort
(B) Heap Sort
(C) Quick Sort
(D) Selection Sort
36. : What is the primary advantage of using Counting Sort?
(A) It works on any data type
(B) It is a non-comparison-based algorithm
(C) It is stable
(D) It has low memory requirements
37. : In which sorting algorithm does the input size significantly affect the time complexity?
(A) Merge Sort
(B) Quick Sort
(C) Insertion Sort
(D) Bubble Sort
38. : Which sorting algorithm is best suited for sorting linked lists?
(A) Merge Sort
(B) Quick Sort
(C) Bubble Sort
(D) Heap Sort