Interpolation search is most likely to outperform binary search when:
The array size is small.
The target element is located near the middle of the array.
The array is unsorted.
The array is uniformly distributed.
Which of the following statements is TRUE about Quick Sort?
It always has a time complexity of O(n log n).
It is generally preferred over Merge Sort for arrays.
It performs poorly on already sorted arrays if the pivot selection is not optimized.
It is a stable sorting algorithm.
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
Linear Search
Binary Search
What is the time complexity of rotating an array of size 'n' by 'k' positions in place?
O(n*k)
O(k)
O(1)
O(n)
What is the time complexity of searching for a target value in a sorted array using binary search?
O(log n)
O(n log n)
What is the primary data structure used in Heap Sort?
Linked List
Queue
Stack
Binary Heap
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?
Quick Sort
Bubble Sort
What is a key characteristic of a circular array?
It allows direct access to any element in O(1) time.
It conceptually wraps around, so the last element is followed by the first.
It automatically sorts elements in ascending order.
It has a fixed size that cannot be changed.
You are designing a system to store a large sparse matrix where memory usage is critical. Which approach is most suitable?
Use a dynamic array and resize it as needed.
Store the matrix in a text file and read it when needed.
Implement the sparse matrix using a hash table.
Use a standard 2D array.
In which scenario is a sparse array particularly useful?
Storing a small array with frequent updates
Representing a matrix with mostly zero values
Storing a large sorted array
Implementing a stack data structure