What is the space complexity of Bubble Sort in its standard form?
O(n^2)
O(1)
O(n)
O(log n)
Is Bubble Sort a stable sorting algorithm?
Stability is irrelevant for Bubble Sort
No
Only in its optimized version
Yes
Which of the following sorting algorithms is categorized as NON-comparison based?
Insertion Sort
Radix Sort
Quick Sort
Merge Sort
Which sorting algorithm is generally considered more efficient for small datasets?
Selection Sort
It depends on the data distribution
They have the same efficiency
Bubble Sort
Bubble sort performs better than selection sort in which scenario?
When the input array is randomly ordered.
Bubble sort never outperforms Selection sort
When the input array is already sorted.
When the input array is reversely sorted.
Which of the following sorting algorithms has the best-case time complexity of O(n)?
Both Bubble Sort and Selection Sort
Neither Bubble Sort nor Selection Sort
How does Insertion Sort build the sorted portion of the array?
By finding the minimum element and placing it at the beginning
By recursively dividing the array into halves
By comparing and swapping adjacent elements
By iteratively expanding a sorted subarray from left to right
What does it mean for a sorting algorithm to be 'in-place'?
It sorts the data without requiring significant additional storage space.
It is the fastest possible sorting algorithm for a given data set.
It sorts the data in its original location without moving elements.
It can sort data of any type, including numbers, text, and images.
Why is Insertion Sort not preferred for large datasets?
It has a high space complexity
It is difficult to implement
Its time complexity is quadratic in the worst case
It is not a stable sorting algorithm
Why is understanding the time and space complexity of sorting algorithms crucial?
To predict the output of a sorting algorithm without actually executing it.
To determine the exact number of comparisons and swaps performed by an algorithm.
To estimate the efficiency and resource usage of an algorithm for different input sizes.
To convert between different sorting algorithms.