What is the time complexity of an algorithm with nested loops, where each loop iterates n times?
O(n^2)
O(n log n)
O(n^3)
O(log n)
Which sorting algorithm is generally considered the fastest for large datasets with an average time complexity of O(n log n)?
Merge Sort
Bubble Sort
Insertion Sort
Selection Sort
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?
O(1)
O(n)
Which of these Big-O notations represents the most efficient algorithm for large input sizes?
What is the worst-case time complexity of the linear search algorithm?
If an algorithm has a time complexity of O(n log n), what can you infer about its runtime as the input size doubles?
It remains constant
It increases by a factor of log n
It increases slightly more than double
It increases exponentially
What is the time complexity of the QuickSort algorithm in the worst-case scenario?
What is the time complexity of accessing an element in an array using its index?
What does an algorithm with a time complexity of O(n) signify?
The runtime is constant regardless of input size
The runtime is unpredictable
The runtime increases linearly with the input size
The runtime increases exponentially with the input size
In what scenario might an algorithm with a worse theoretical time complexity perform better in practice than one with a better complexity?
When the input data size is very small.
When the algorithm with better complexity has a very large constant factor hidden in its Big O notation.
All of the above.
When the algorithm with worse complexity is implemented in a more efficient programming language.