What is the time complexity of adding an element at the end of a dynamic array (ArrayList in Java, vector in C++) if there is enough capacity?
O(n)
O(log n)
O(n log n)
O(1)
What is the time complexity of an algorithm with nested loops, where each loop iterates n times?
O(n^2)
O(n^3)
Which time complexity is represented by an algorithm that iterates through a list of size n and performs a constant time operation in each iteration?
Which data structure, when used for searching, can potentially improve the time complexity from O(n) to O(log n)?
Linked List
Binary Tree
Array
Queue
Which searching algorithm has a time complexity of O(log n) in the average case?
Binary Search
Jump Search
Interpolation Search
Linear Search
What is the primary focus of Big-O notation in time complexity analysis?
Describing the upper bound of an algorithm's growth rate
Expressing the exact number of operations an algorithm performs
Representing the lower bound of an algorithm's growth rate
Calculating the average-case runtime of an algorithm
Which of the following operations typically represents constant time complexity, O(1)?
Sorting an array using bubble sort
Finding the smallest element in a sorted array
Searching for a specific value in an unsorted array
Inserting an element at the beginning of a linked list
Which of the following typically represents the most inefficient time complexity for large input sizes?
O(n!)
O(2^n)
Merge sort and heapsort are examples of sorting algorithms with which time complexity?
What does an algorithm with a time complexity of O(n) signify?
The runtime is unpredictable
The runtime increases exponentially with the input size
The runtime increases linearly with the input size
The runtime is constant regardless of input size