Why is Insertion Sort not preferred for large datasets?
It is difficult to implement
It has a high space complexity
It is not a stable sorting algorithm
Its time complexity is quadratic in the worst case
Which of these situations might make Bubble Sort a suitable choice?
Sorting data with a complex key structure
Real-time applications where speed is critical
Sorting a very large dataset
When the input array is almost sorted
Which of the following sorting algorithms has the best-case time complexity of O(n)?
Selection Sort
Bubble Sort
Both Bubble Sort and Selection Sort
Neither Bubble Sort nor Selection Sort
What is a key limitation of both Bubble Sort and Selection Sort?
They are not stable sorting algorithms
They have a high space complexity
They are inefficient for large datasets
They cannot handle arrays with duplicate elements
Why are sorting algorithms considered fundamental in computer science?
They are only used in specific niche applications.
They are primarily used for displaying data to the user.
They are rarely used in modern software development.
They are the basis for more complex algorithms and data structures.
When does Insertion Sort exhibit its worst-case time complexity?
When all elements in the array are the same
When the array is reverse sorted
When the array is already sorted
When the array has a random distribution of elements
Which statement BEST describes the significance of understanding sorting algorithms?
It's only essential for software engineers specializing in algorithm development.
It enables developers to choose the most suitable algorithm for a given task based on efficiency and data characteristics.
All sorting algorithms perform equally well, so understanding them is unnecessary.
It's primarily a theoretical concept with little practical relevance.
Which of the following sorting algorithms is NOT comparison-based?
Merge Sort
Insertion Sort
Radix Sort
Which of the following is a real-world analogy for how Insertion Sort works?
Arranging cards in a hand by suit and rank
Shuffling a deck of cards
Searching for a specific webpage on the internet
Finding a book in a library by its Dewey Decimal number
What is the best-case time complexity of Insertion Sort?
O(n log n)
O(1)
O(n^2)
O(n)