Which of the following sorting algorithms is categorized as NON-comparison based?
Merge Sort
Insertion Sort
Quick Sort
Radix Sort
Which of the following is a real-world application of sorting in databases?
Data encryption for enhanced security.
Query optimization for faster retrieval of results.
Natural language processing for text analysis.
Data compression for efficient storage.
Which of these characteristics is typically used to analyze and compare the efficiency of sorting algorithms?
Code readability, which refers to how easy the code is to understand.
The specific data values being sorted.
Time complexity, which measures the number of operations as data size grows.
Programming language used to implement the algorithm.
What is the best-case time complexity of Insertion Sort?
O(n^2)
O(n log n)
O(1)
O(n)
In what real-world scenario might you encounter the need for a sorting algorithm?
Displaying search results in order of relevance.
Compressing an image file to reduce its size.
Generating random numbers within a specified range.
Encrypting a message for secure communication.
Bubble sort performs better than selection sort in which scenario?
When the input array is reversely sorted.
When the input array is already sorted.
Bubble sort never outperforms Selection sort
When the input array is randomly ordered.
Is Bubble Sort a stable sorting algorithm?
No
Only in its optimized version
Stability is irrelevant for Bubble Sort
Yes
Is Selection Sort a stable sorting algorithm?
Stability is irrelevant for Selection Sort
What is the fundamental difference between comparison-based and non-comparison-based sorting algorithms?
Comparison-based algorithms are more memory efficient than non-comparison-based algorithms.
Comparison-based algorithms are used for numerical data, while non-comparison-based algorithms are used for text data.
Comparison-based algorithms are faster than non-comparison-based algorithms.
Comparison-based algorithms sort by comparing elements, while non-comparison-based algorithms exploit data properties for sorting.
Why are sorting algorithms considered fundamental in computer science?
They are rarely used in modern software development.
They are only used in specific niche applications.
They are primarily used for displaying data to the user.
They are the basis for more complex algorithms and data structures.