What is the space complexity of Merge Sort?
O(log n)
O(1)
O(n log n)
O(n)
What makes Hoare's partitioning scheme generally preferred over Lomuto's in Quick Sort implementations?
Hoare's scheme performs fewer swaps on average, leading to better performance
Lomuto's scheme always selects the last element as the pivot, leading to worse performance
Lomuto's scheme is not suitable for arrays with duplicate elements
Hoare's scheme is more intuitive and easier to implement
In which scenario is Bucket Sort likely to perform poorly?
Data is already sorted in reverse order
Data is heavily skewed towards one end of the range
Data consists of a small number of unique elements
Data is uniformly distributed within a known range
What is the worst-case time complexity of Quick Sort and when does it occur?
O(n^2), when the pivot is always the median element
O(n^2), when the input array is already sorted or reverse sorted
O(n log n), when the pivot is always the median element
O(n log n), when the input array is sorted or reverse sorted
What is the significance of lexicographic sorting in string processing?
It sorts strings based on their lengths, from shortest to longest or vice versa.
It sorts strings based on the number of vowels they contain.
It sorts strings based on their hash values, making it very efficient for comparing large strings.
It sorts strings in alphabetical order, considering the order of characters defined by the character encoding (e.g., ASCII or Unicode).
What is the primary advantage of using a binary heap in Heap Sort?
Efficient searching of elements
Constant time insertion of elements
Low memory overhead compared to other heap structures
Maintaining a sorted order during element extraction
What is the worst-case time complexity of Merge Sort?
O(n^2)
Is Heap Sort a stable sorting algorithm?
Yes
No
What is the primary mechanism behind Merge Sort's efficiency?
Iterative comparison of adjacent elements
Recursive division of the input array into smaller subarrays
Using a hash table to store and retrieve sorted elements
Building a binary search tree from the input data
Radix Sort utilizes which of the following properties of the input data to achieve its efficiency?
Frequency of occurrence of data elements
Distribution of the data values within a range
Pre-sortedness of the data
Order statistics of the data