3. Algorithms and Analysis
Sorting Algorithms — Quiz
Test your understanding of sorting algorithms with 5 practice questions.
Practice Questions
Question 1
Which sorting algorithm has a worst-case time complexity of $O(n \log n)$ and is known for its guaranteed performance, making it suitable for applications where consistent performance is critical?
Question 2
In Quick Sort, if the pivot element is always chosen as the first element of the array, what kind of input array would lead to its worst-case time complexity of $O(n^2)$?
Question 3
Consider the array $[3, 1, 4, 1, 5, 9, 2, 6]$. After applying Merge Sort to this array, what will be the sorted output?
Question 4
Which of the following sorting algorithms is generally considered the most efficient for very small arrays (e.g., fewer than 10-20 elements) due to its low constant factors and minimal overhead?
Question 5
What is the primary reason that Selection Sort is rarely used in practice for large datasets, despite its simplicity?
