Which of the following is a real-world application of sorting in databases?
Natural language processing for text analysis.
Query optimization for faster retrieval of results.
Data encryption for enhanced security.
Data compression for efficient storage.
What is a key limitation of both Bubble Sort and Selection Sort?
They have a high space complexity
They are inefficient for large datasets
They are not stable sorting algorithms
They cannot handle arrays with duplicate elements
Why is Insertion Sort not preferred for large datasets?
Its time complexity is quadratic in the worst case
It is difficult to implement
It is not a stable sorting algorithm
It has a high space complexity
Which of the following sorting algorithms is categorized as NON-comparison based?
Quick Sort
Merge Sort
Insertion Sort
Radix Sort
What is the primary operation used in Insertion Sort to place an element in its correct position?
Merging
Shifting
Swapping
Comparison
Which of the following is NOT a valid reason for using sorting algorithms?
Improving the performance of searching algorithms.
Compressing files for storage efficiency.
Presenting data in a user-friendly order.
Finding the median of a dataset.
What is the worst-case space complexity of Insertion Sort?
O(1)
O(n)
O(log n)
O(n log n)
Is Selection Sort a stable sorting algorithm?
Only in its optimized version
Stability is irrelevant for Selection Sort
No
Yes
Insertion Sort can be considered an incremental algorithm. What does this mean?
It divides the problem into smaller subproblems
It can handle data arriving in a continuous stream
It requires the entire dataset to be present in memory
It performs better on smaller datasets
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