What is the time complexity of deleting a given value from an unsorted array in the worst case?
O(1)
O(n log n)
O(log n)
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 is a stable sorting algorithm.
It always has a time complexity of O(n log n).
It is generally preferred over Merge Sort for arrays.
You are designing a system to store a large sparse matrix where memory usage is critical. Which approach is most suitable?
Store the matrix in a text file and read it when needed.
Use a dynamic array and resize it as needed.
Implement the sparse matrix using a hash table.
Use a standard 2D array.
Which data structure is most suitable for implementing a sorted array with efficient insertion and deletion operations?
Linked List
Queue
Stack
Array
What is the time complexity of resizing a dynamic array (like ArrayList in Java or vector in C++) when it becomes full?
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.
What is the time complexity of inserting an element into a Max Heap containing 'n' elements?
Which sorting algorithm would be most suitable for sorting a very large dataset that cannot fit entirely in RAM?
Heap Sort
Merge Sort
Quick Sort
Rotating an array by 'k' positions to the right means:
Reversing the entire array.
Shifting each element 'k' positions to the left.
Shifting each element 'k' positions to the right.
Sorting the array in descending order.
What is the primary data structure used in Heap Sort?
Binary Heap