What is the worst-case time complexity of Selection Sort?
O(n^2)
O(n log n)
O(log n)
O(n)
Which sorting algorithm is generally considered more efficient for small datasets?
Bubble Sort
They have the same efficiency
Selection Sort
It depends on the data distribution
What is the fundamental difference between comparison-based and non-comparison-based sorting algorithms?
Comparison-based algorithms sort by comparing elements, while non-comparison-based algorithms exploit data properties for sorting.
Comparison-based algorithms are used for numerical data, while non-comparison-based algorithms are used for text data.
Comparison-based algorithms are more memory efficient than non-comparison-based algorithms.
Comparison-based algorithms are faster than non-comparison-based algorithms.
Why is understanding the time and space complexity of sorting algorithms crucial?
To convert between different sorting algorithms.
To determine the exact number of comparisons and swaps performed by an algorithm.
To predict the output of a sorting algorithm without actually executing it.
To estimate the efficiency and resource usage of an algorithm for different input sizes.
Insertion Sort can be considered an incremental algorithm. What does this mean?
It requires the entire dataset to be present in memory
It performs better on smaller datasets
It can handle data arriving in a continuous stream
It divides the problem into smaller subproblems
Why is Insertion Sort not preferred for large datasets?
It has a high space complexity
Its time complexity is quadratic in the worst case
It is difficult to implement
It is not a stable sorting algorithm
Which algorithm repeatedly finds the minimum element from the unsorted part and puts it at the beginning?
Merge Sort
Quick Sort
Which of the following sorting algorithms is categorized as NON-comparison based?
Insertion Sort
Radix Sort
What does it mean for a sorting algorithm to be 'in-place'?
It is the fastest possible sorting algorithm for a given data set.
It can sort data of any type, including numbers, text, and images.
It sorts the data without requiring significant additional storage space.
It sorts the data in its original location without moving elements.
Which of these situations might make Bubble Sort a suitable choice?
Sorting data with a complex key structure
Sorting a very large dataset
Real-time applications where speed is critical
When the input array is almost sorted