What is the worst-case time complexity of Merge Sort?
O(n)
O(n^2)
O(n log n)
O(log n)
Which of the following real-world applications is well-suited for counting sort?
Sorting a collection of images based on their file sizes.
Sorting an array of timestamps representing events in chronological order.
Sorting a large dataset of student GPAs ranging from 0.0 to 4.0.
Sorting a list of words alphabetically.
Is Heap Sort a stable sorting algorithm?
No
Yes
What is a key limitation of counting sort?
It is only efficient for datasets with an even number of elements.
It cannot sort datasets containing duplicate values.
Its space complexity can be significant if the range of input values is large.
It is not suitable for sorting strings or objects.
What is the purpose of the partitioning step in the Quick Sort algorithm?
To merge two sorted subarrays into a single sorted array
To sort the entire array in ascending order
To divide the array into two subarrays such that all elements in the left subarray are less than or equal to the pivot and all elements in the right subarray are greater than the pivot
To find the median element of the array
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 has a lower space complexity than Bubble Sort.
Merge Sort is an in-place sorting algorithm, while Bubble Sort is not.
Merge Sort's time complexity scales better with increasing data size.
What is the primary advantage of using a binary heap in Heap Sort?
Constant time insertion of elements
Maintaining a sorted order during element extraction
Efficient searching of elements
Low memory overhead compared to other heap structures
Radix Sort utilizes which of the following properties of the input data to achieve its efficiency?
Order statistics of the data
Distribution of the data values within a range
Pre-sortedness of the data
Frequency of occurrence of data elements
Bucket Sort achieves its efficiency by:
Recursively dividing the input into smaller subproblems
Exploiting the relative order of elements within the input
Distributing elements into buckets based on their range
Using a priority queue to maintain sorted order during insertion
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 with floating-point numbers.
Datasets containing negative integers.