What is a key limitation of both Bubble Sort and Selection Sort?
They have a high space complexity
They cannot handle arrays with duplicate elements
They are inefficient for large datasets
They are not stable sorting algorithms
Which of the following sorting algorithms is NOT comparison-based?
Radix Sort
Merge Sort
Bubble Sort
Insertion Sort
When does Insertion Sort exhibit its worst-case time complexity?
When the array is reverse sorted
When the array is already sorted
When the array has a random distribution of elements
When all elements in the array are the same
Which of the following sorting algorithms is categorized as NON-comparison based?
Quick Sort
Bubble sort performs better than selection sort in which scenario?
When the input array is reversely sorted.
When the input array is randomly ordered.
When the input array is already sorted.
Bubble sort never outperforms Selection sort
Insertion Sort can be considered an incremental algorithm. What does this mean?
It performs better on smaller datasets
It requires the entire dataset to be present in memory
It divides the problem into smaller subproblems
It can handle data arriving in a continuous stream
Is Bubble Sort a stable sorting algorithm?
Yes
Only in its optimized version
No
Stability is irrelevant for Bubble Sort
What is the primary operation used in Insertion Sort to place an element in its correct position?
Comparison
Shifting
Merging
Swapping
In what real-world scenario might you encounter the need for a sorting algorithm?
Displaying search results in order of relevance.
Encrypting a message for secure communication.
Compressing an image file to reduce its size.
Generating random numbers within a specified range.
Sorting algorithms can be broadly classified into two categories. What are they?
Stable and Unstable
Comparison-based and Non-comparison-based
Recursive and Iterative
In-place and Out-of-place