WorksheetsIT6 (Finals) - Quiz 2
Total questions: 15
Worksheet time: 5mins
Which of the following is a primary reason why sorting data is important?
It helps in random data access.
It improves search efficiency, such as in binary search.
It reduces the total memory footprint of the data.
It encrypts data for secure storage.
What is one of the key properties used to describe sorting algorithms?
Portability
Scalability
Stability
Versatility
Which sorting algorithm repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order?
Insertion Sort
Selection Sort
Merge Sort
Bubble Sort
What is the best-case time complexity for Bubble Sort when the list is already sorted?
O(n^2)
O(log n)
O(n)
O(n log n)
Which characteristic best describes Bubble Sort for large datasets?
Highly efficient
Optimally space-efficient
Highly inefficient
Suitable for parallel processing
In Selection Sort, how is the list conceptually divided during the sorting process?
Into two halves based on value.
Into a pivot and two sub-arrays.
Into a sorted sublist and an unsorted sublist.
Into blocks of equal size.
A key difference between Selection Sort and Bubble Sort is that Selection Sort generally performs:
More comparisons
Fewer swaps
More passes
More memory allocations
What is the time complexity for Selection Sort in its best, worst, and average cases?
O(n) in best, O(n^2) in worst, O(n log n) in average
O(n log n) in all cases
O(n^2) in all cases
O(n) in all cases
Which sorting algorithm builds the final sorted array one item at a time by inserting each element into its correct position within the already sorted part?
Bubble Sort
Quick Sort
Insertion Sort
Heap Sort
For what type of lists is Insertion Sort particularly efficient?
Very large, randomly ordered lists
Lists with duplicate elements
Small lists or nearly sorted lists
Lists stored in external memory
What is the best-case time complexity for Insertion Sort?
O(n^2)
O(n log n)
O(n)
O(1)
Which of the following is true regarding the stability of Bubble Sort and Insertion Sort?
Both are unstable.
Bubble Sort is stable, but Insertion Sort is unstable.
Both are stable.
Bubble Sort is unstable, but Insertion Sort is stable.
What is the average and worst-case time complexity shared by Bubble Sort, Selection Sort, and Insertion Sort?
O(n log n)
O(n)
O(n^2)
O(log n)
Why are Bubble Sort, Selection Sort, and Insertion Sort generally not suitable for very large datasets?
They require excessive pre-processing.
They have significant performance limitations due to their quadratic time complexity.
They are complex to implement for large-scale systems.
They consume too much auxiliary space.
In what scenario might Insertion Sort be preferred over other O(n^2) algorithms?
When the list is guaranteed to be completely unsorted.
For lists with extremely large elements.
For small arrays or nearly sorted arrays due to its low overhead.
When the sorting must be performed in-place without any extra memory.
