1. What is the primary purpose of Quick Sort?
(A) To search for an element
(B) To sort an array
(C) To merge two arrays
(D) To partition data
2. What is the average-case time complexity of Quick Sort?
(A) O(n)
(B) O(n log n)
(C) O(n²)
(D) O(log n)
3. Which of the following best describes the Quick Sort algorithm?
(A) It repeatedly swaps adjacent elements.
(B) It selects a pivot and partitions the array.
(C) It sorts the array in place without additional memory.
(D) It merges sorted arrays.
4. What is the worst-case time complexity of Quick Sort?
(A) O(n)
(B) O(n log n)
(C) O(n²)
(D) O(log n)
5. Which of the following is true about the stability of Quick Sort?
(A) It is a stable sorting algorithm.
(B) It is not a stable sorting algorithm.
(C) It can only sort numerical data.
(D) It requires additional memory for stability.
6. What is the space complexity of Quick Sort?
(A) O(1)
(B) O(n)
(C) O(n log n)
(D) O(n²)
7. What is the main advantage of Quick Sort over other sorting algorithms?
(A) It is always faster than Merge Sort.
(B) It requires less memory.
(C) It can sort linked lists efficiently.
(D) It is a stable sorting algorithm.
8. Which of the following is a common method for choosing a pivot in Quick Sort?
(A) First element
(B) Last element
(C) Median of three
(D) Random element
9. In Quick Sort, what happens if the pivot is the smallest or largest element?
(A) The algorithm will be very efficient.
(B) The algorithm will perform poorly, resulting in O(n²) complexity.
(C) The array will remain unchanged.
(D) The algorithm will terminate immediately.
10. How does Quick Sort compare to Merge Sort in terms of worst-case performance?
(A) Quick Sort has worse performance.
(B) Merge Sort has worse performance.
(C) Both have the same performance.
(D) It depends on the implementation.