What is the worst-case space complexity of Insertion Sort?
O(1)
O(n log n)
O(log n)
O(n)
Which of the following is NOT a valid reason for using sorting algorithms?
Compressing files for storage efficiency.
Improving the performance of searching algorithms.
Finding the median of a dataset.
Presenting data in a user-friendly order.
Which of the following is a real-world analogy for how Insertion Sort works?
Finding a book in a library by its Dewey Decimal number
Searching for a specific webpage on the internet
Shuffling a deck of cards
Arranging cards in a hand by suit and rank
Why are sorting algorithms considered fundamental in computer science?
They are primarily used for displaying data to the user.
They are the basis for more complex algorithms and data structures.
They are rarely used in modern software development.
They are only used in specific niche applications.
Why is Insertion Sort not preferred for large datasets?
Its time complexity is quadratic in the worst case
It is not a stable sorting algorithm
It is difficult to implement
It has a high space complexity
Is Selection Sort a stable sorting algorithm?
Only in its optimized version
Stability is irrelevant for Selection Sort
No
Yes
In what real-world scenario might you encounter the need for a sorting algorithm?
Generating random numbers within a specified range.
Compressing an image file to reduce its size.
Encrypting a message for secure communication.
Displaying search results in order of relevance.
What does it mean for a sorting algorithm to be 'in-place'?
It sorts the data without requiring significant additional storage space.
It can sort data of any type, including numbers, text, and images.
It is the fastest possible sorting algorithm for a given data set.
It sorts the data in its original location without moving elements.
Is Bubble Sort a stable sorting algorithm?
Stability is irrelevant for Bubble Sort
What is a key limitation of both Bubble Sort and Selection Sort?
They cannot handle arrays with duplicate elements
They are not stable sorting algorithms
They are inefficient for large datasets
They have a high space complexity