Why is Insertion Sort not preferred for large datasets?
It has a high space complexity
It is not a stable sorting algorithm
It is difficult to implement
Its time complexity is quadratic in the worst case
Which of the following is a real-world application of sorting in databases?
Data compression for efficient storage.
Data encryption for enhanced security.
Natural language processing for text analysis.
Query optimization for faster retrieval of results.
Which of the following sorting algorithms has the best-case time complexity of O(n)?
Bubble Sort
Selection Sort
Both Bubble Sort and Selection Sort
Neither Bubble Sort nor Selection Sort
Sorting algorithms can be broadly classified into two categories. What are they?
Stable and Unstable
Comparison-based and Non-comparison-based
In-place and Out-of-place
Recursive and Iterative
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 is a real-world analogy for how Insertion Sort works?
Shuffling a deck of cards
Searching for a specific webpage on the internet
Arranging cards in a hand by suit and rank
Finding a book in a library by its Dewey Decimal number
What is the worst-case time complexity of Selection Sort?
O(log n)
O(n^2)
O(n log n)
O(n)
What is the space complexity of Bubble Sort in its standard form?
O(1)
When does Insertion Sort exhibit its worst-case time complexity?
When the array is already sorted
When the array is reverse sorted
When the array has a random distribution of elements
When all elements in the array are the same
What is the worst-case space complexity of Insertion Sort?