What is the time complexity of resizing a dynamic array (like ArrayList in Java or vector in C++) when it becomes full?
O(n)
O(1)
O(n log n)
O(log n)
Which of the following is NOT a characteristic of a stable sorting algorithm?
Always has a time complexity of O(n log n).
Can be implemented in both recursive and iterative forms.
Preserves the order of equal elements.
Suitable for sorting objects based on multiple criteria.
Quick Sort is generally considered faster than Merge Sort in practice. What is one of the main reasons for this?
Quick Sort has better space complexity than Merge Sort.
Quick Sort has better time complexity in all cases.
Quick Sort is a stable sorting algorithm, while Merge Sort is not.
Quick Sort typically has smaller constant factors in its time complexity.
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.
Implement the sparse matrix using a hash table.
Use a dynamic array and resize it as needed.
Use a standard 2D array.
What is a key characteristic of a circular array?
It automatically sorts elements in ascending order.
It allows direct access to any element in O(1) time.
It has a fixed size that cannot be changed.
It conceptually wraps around, so the last element is followed by the first.
Which of the following is NOT a valid approach for array rotation?
Merge Sort Algorithm
Block Swap Algorithm
Reversal Algorithm
Juggling Algorithm
What is the time complexity of inserting an element into a Max Heap containing 'n' elements?
What data structure is commonly used to implement a sparse array efficiently?
Queue
Hash Table
Binary Tree
Linked List
What is the main challenge in implementing a circular array?
Handling the resizing of the array
Managing the wrap-around behavior correctly
Efficiently searching for elements in the array
Determining the starting index of the array
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
Interpolation Search
Linear Search
Binary Search