What is a potential limitation of Heap Sort compared to some other efficient sorting algorithms?
It requires the entire dataset to be in memory.
It is less efficient when the input data is already nearly sorted.
Its average-case time complexity is worse than some other algorithms.
It is not well-suited for sorting linked lists.
Counting sort is particularly well-suited for sorting:
Small datasets with a limited range of values.
Large datasets with a wide range of values.
Datasets containing negative integers.
Datasets with floating-point numbers.
What is the primary advantage of using a binary heap in Heap Sort?
Constant time insertion of elements
Low memory overhead compared to other heap structures
Efficient searching of elements
Maintaining a sorted order during element extraction
What is the worst-case time complexity of Merge Sort?
O(n^2)
O(log n)
O(n)
O(n log n)
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 in alphabetical order, considering the order of characters defined by the character encoding (e.g., ASCII or Unicode).
It sorts strings based on their hash values, making it very efficient for comparing large strings.
It sorts strings based on the number of vowels they contain.
Which of the following real-world applications is well-suited for counting sort?
Sorting a list of words alphabetically.
Sorting an array of timestamps representing events in chronological order.
Sorting a collection of images based on their file sizes.
Sorting a large dataset of student GPAs ranging from 0.0 to 4.0.
What is the primary mechanism behind Merge Sort's efficiency?
Recursive division of the input array into smaller subarrays
Using a hash table to store and retrieve sorted elements
Iterative comparison of adjacent elements
Building a binary search tree from the input data
How does Merge Sort handle the base case of a single-element subarray?
It recursively divides the single-element array.
It throws an error, as a single-element array cannot be sorted.
It considers a single-element array as inherently sorted.
It performs a swap operation on the element.
Why is Quick Sort often preferred over Merge Sort in practice, despite having the same average-case time complexity?
Quick Sort has a lower constant factor in its time complexity, making it faster for smaller datasets
Quick Sort is easier to parallelize and implement on multi-core processors
Quick Sort is an in-place sorting algorithm, while Merge Sort requires additional space for merging
Quick Sort is more memory-efficient due to its recursive nature
Bucket Sort can be considered a stable sorting algorithm under which condition?
The underlying sorting algorithm used within each bucket is stable.
The number of buckets is equal to the number of elements.
Bucket Sort is inherently stable regardless of the input or implementation.
The input data is already sorted.