What is the worst-case time complexity of deleting an element from an unsorted array?
O(n log n)
O(1)
O(log n)
O(n)
What does it mean if an algorithm has a time complexity of Ω(n log n)?
It runs in at least n log n time.
It runs in exactly n log n time.
It has a logarithmic growth rate.
It runs in at most n log n time.
In what scenario might an algorithm with a worse theoretical time complexity perform better in practice than one with a better complexity?
All of the above.
When the algorithm with better complexity has a very large constant factor hidden in its Big O notation.
When the algorithm with worse complexity is implemented in a more efficient programming language.
When the input data size is very small.
What is the best-case time complexity of the insertion sort algorithm?
Which notation provides both an upper and lower bound on the growth of a function, implying the function grows at the same rate as the specified function?
Little-omega (ω)
Big Omega (Ω)
Big Theta (Θ)
Big-O (O)
Which data structure, when used for searching, can potentially improve the time complexity from O(n) to O(log n)?
Queue
Linked List
Array
Binary Tree
What is the time complexity of an algorithm with nested loops, where each loop iterates n times?
O(n^2)
O(n^3)
Which notation is most useful when analyzing the average-case time complexity of an algorithm, considering all possible inputs?
All notations are equally useful for average-case analysis.
Little-o (o)
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 slightly more than double
It increases exponentially
It increases by a factor of log n
Why is understanding time complexity crucial in algorithm analysis?
To determine the exact execution time of an algorithm
To predict how the performance of an algorithm scales with larger inputs
To calculate the cost of developing an algorithm
To compare the aesthetic quality of different algorithms