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
Which of the following sorting algorithms is NOT comparison-based?
Merge Sort
Insertion Sort
Bubble Sort
Radix Sort
Is Selection Sort a stable sorting algorithm?
Yes
No
Only in its optimized version
Stability is irrelevant for Selection Sort
Why are sorting algorithms considered fundamental in computer science?
They are rarely used in modern software development.
They are the basis for more complex algorithms and data structures.
They are primarily used for displaying data to the user.
They are only used in specific niche applications.
What does it mean for a sorting algorithm to be 'in-place'?
It is the fastest possible sorting algorithm for a given data set.
It sorts the data without requiring significant additional storage space.
It can sort data of any type, including numbers, text, and images.
It sorts the data in its original location without moving elements.
What is a key limitation of both Bubble Sort and Selection Sort?
They are not stable sorting algorithms
They are inefficient for large datasets
They have a high space complexity
They cannot handle arrays with duplicate elements
What is the worst-case time complexity of Selection Sort?
O(n log n)
O(log n)
O(n)
O(n^2)
Which of the following is a real-world application of sorting in databases?
Query optimization for faster retrieval of results.
Data compression for efficient storage.
Natural language processing for text analysis.
Data encryption for enhanced security.
Sorting algorithms can be broadly classified into two categories. What are they?
Recursive and Iterative
Comparison-based and Non-comparison-based
In-place and Out-of-place
Stable and Unstable
Is Bubble Sort a stable sorting algorithm?
Stability is irrelevant for Bubble Sort