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 has better time complexity in all cases.
Quick Sort typically has smaller constant factors in its time complexity.
Which searching technique is most suitable for searching for a target element in a sorted array that is rotated at an unknown pivot point?
Linear Search
Depth First Search
Interpolation Search
Binary Search
You need to implement a buffer that stores a fixed number of recent data points, discarding older data as new data arrives. Which array-based structure would be most appropriate?
Standard array with shifting elements on each insertion
Circular array to efficiently manage the fixed-size buffer
Sparse array to handle potentially sparse data
Dynamic array (ArrayList, vector) to accommodate varying data sizes
You want to search for a target value in a sorted array with millions of elements. Which algorithm would generally be the fastest?
Jump Search
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
Which data structure is most suitable for implementing a sorted array with efficient insertion and deletion operations?
Queue
Stack
Linked List
Array
You have a sorted array of 1000 elements. What is the maximum number of comparisons a binary search algorithm would need to find a target element or determine it's not present?
500
1000
10
100
What is the time complexity of resizing a dynamic array (like ArrayList in Java or vector in C++) when it becomes full?
O(1)
O(n log n)
O(n)
O(log n)
You are searching for a target value in a 2D matrix where each row and column is sorted in ascending order. Which search algorithm is the most efficient?
Breadth First Search
Binary Search on each row
Staircase Search
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.
Use a standard 2D array.
Implement the sparse matrix using a hash table.
Store the matrix in a text file and read it when needed.