Counting sort is particularly well-suited for sorting:
Small datasets with a limited range of values.
Datasets with floating-point numbers.
Datasets containing negative integers.
Large datasets with a wide range of values.
Which of the following describes the space complexity of counting sort?
O(n + k), where k is the range of input values
O(1)
O(n)
O(log n)
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.
The input data is already sorted.
Bucket Sort is inherently stable regardless of the input or implementation.
How does the space complexity of Heap Sort compare to other comparison-based sorting algorithms?
Heap Sort has a higher space complexity
Heap Sort's space complexity depends on the input data
Heap Sort typically has the same space complexity
Heap Sort has a lower space complexity
Which of the following best describes the heap property in a binary heap used for Heap Sort?
Each node is smaller than or equal to its children
The left and right subtrees are sorted
Each node is greater than or equal to its children
The heap is always a complete binary tree
Which of the following is a common use case for Merge Sort?
Sorting a linked list
Sorting a small array with less than 10 elements
Finding the smallest element in an array
Sorting a nearly sorted array
What makes Hoare's partitioning scheme generally preferred over Lomuto's in Quick Sort implementations?
Lomuto's scheme is not suitable for arrays with duplicate elements
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
Hoare's scheme is more intuitive and easier to implement
What is the primary disadvantage of using Radix Sort compared to comparison-based sorting algorithms?
Significant performance degradation for nearly sorted data
Higher space complexity due to bucket usage
Limited applicability to specific data types
Inability to handle negative numbers effectively
How does the choice of pivot affect the performance of Quick Sort?
A poorly chosen pivot can lead to the worst-case time complexity of O(n^2)
Using the first element as the pivot is generally the most efficient approach
The choice of pivot has no impact on the performance of Quick Sort
Selecting a random pivot always guarantees the best performance
Why is Merge Sort often preferred over simpler algorithms like Bubble Sort for large datasets?
Merge Sort's recursive approach is easier to implement.
Merge Sort is an in-place sorting algorithm, while Bubble Sort is not.
Merge Sort has a lower space complexity than Bubble Sort.
Merge Sort's time complexity scales better with increasing data size.