Why is Insertion Sort not preferred for large datasets?
It has a high space complexity
It is difficult to implement
It is not a stable sorting algorithm
Its time complexity is quadratic in the worst case
Which of the following sorting algorithms has the best-case time complexity of O(n)?
Neither Bubble Sort nor Selection Sort
Both Bubble Sort and Selection Sort
Bubble Sort
Selection Sort
Which of the following is a real-world analogy for how Insertion Sort works?
Arranging cards in a hand by suit and rank
Searching for a specific webpage on the internet
Finding a book in a library by its Dewey Decimal number
Shuffling a deck of cards
Which algorithm repeatedly finds the minimum element from the unsorted part and puts it at the beginning?
Quick Sort
Merge Sort
What is the space complexity of Bubble Sort in its standard form?
O(log n)
O(1)
O(n)
O(n^2)
How does Insertion Sort build the sorted portion of the array?
By finding the minimum element and placing it at the beginning
By comparing and swapping adjacent elements
By recursively dividing the array into halves
By iteratively expanding a sorted subarray from left to right
What is the worst-case space complexity of Insertion Sort?
O(n log n)
Sorting algorithms can be broadly classified into two categories. What are they?
Comparison-based and Non-comparison-based
In-place and Out-of-place
Recursive and Iterative
Stable and Unstable
What does it mean for a sorting algorithm to be 'in-place'?
It can sort data of any type, including numbers, text, and images.
It sorts the data in its original location without moving elements.
It sorts the data without requiring significant additional storage space.
It is the fastest possible sorting algorithm for a given data set.
Is Selection Sort a stable sorting algorithm?
Yes
Only in its optimized version
No
Stability is irrelevant for Selection Sort