Which sorting algorithm would be most suitable for sorting a very large dataset that cannot fit entirely in RAM?
Merge Sort
Quick Sort
Heap Sort
Which of the following is NOT a valid approach for array rotation?
Merge Sort Algorithm
Reversal Algorithm
Block Swap Algorithm
Juggling Algorithm
What is the time complexity of searching for a target value in a sorted array using binary search?
O(n log n)
O(log n)
O(1)
O(n)
Which of the following statements is TRUE about Quick Sort?
It performs poorly on already sorted arrays if the pivot selection is not optimized.
It always has a time complexity of O(n log n).
It is a stable sorting algorithm.
It is generally preferred over Merge Sort for arrays.
You are given a sorted array and a target value to insert. Which algorithm offers the best time complexity for inserting the target value while maintaining the sorted order?
Linear Search
Binary Search
Bubble Sort
A dynamic array is used to store a growing dataset. When the array reaches its capacity and needs to resize, what is the common strategy to ensure amortized constant time complexity for appending elements?
Create a new array with exactly the required size.
Double the size of the array when full.
Increase the array size by a fixed constant when full.
Use a linked list instead of resizing the array.
In which scenario is a sparse array particularly useful?
Storing a small array with frequent updates
Storing a large sorted array
Implementing a stack data structure
Representing a matrix with mostly zero values
You want to search for a target value in a sorted array with millions of elements. Which algorithm would generally be the fastest?
Interpolation Search
Jump Search
Quick Sort is generally considered faster than Merge Sort in practice. What is one of the main reasons for this?
Quick Sort is a stable sorting algorithm, while Merge Sort is not.
Quick Sort has better space complexity than Merge Sort.
Quick Sort typically has smaller constant factors in its time complexity.
Quick Sort has better time complexity in all cases.
Which sorting algorithm has the least space complexity among Merge Sort, Quick Sort, and Heap Sort?