What does an algorithm with a time complexity of O(n) signify?
The runtime increases linearly with the input size
The runtime is unpredictable
The runtime increases exponentially with the input size
The runtime is constant regardless of input size
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 increases by a factor of log n
It increases slightly more than double
It remains constant
It increases exponentially
Which of the following statements is TRUE regarding the trade-off between code optimization and readability?
Excessive optimization can sometimes hinder code readability, making maintenance difficult.
There's no trade-off; optimal performance and readability always go hand-in-hand.
Highly optimized code is always easier to read and maintain.
Code readability is irrelevant as long as the code achieves optimal performance.
How does time complexity analysis contribute to selecting the most suitable algorithm for a problem?
It guarantees the shortest possible execution time for any input
It provides a theoretical estimate of an algorithm's efficiency, aiding in informed decisions
It eliminates the need for empirical testing of algorithms
It dictates the specific data structures that should be used in the algorithm
Why is it crucial to consider real-world performance alongside theoretical time complexity analysis when designing algorithms?
Real-world performance is always better than theoretical predictions.
Theoretical analysis is only relevant for academic purposes.
Theoretical analysis is sufficient for predicting real-world performance.
Real-world factors like hardware and data distribution can significantly impact performance.
Which of the following asymptotic notations represents the tightest upper bound on the growth of a function?
Big Omega (Ω)
Big-O (O)
Big Theta (Θ)
Little-o (o)
Which notation represents a strict upper bound, meaning the function grows strictly slower than the specified function?
Little-omega (ω)
If an algorithm's time complexity is O(n^2), what can you conclude about its best-case time complexity?
It cannot be determined from the given information.
It is also O(n^2).
It is Ω(n^2).
It is always constant, i.e., O(1).
What is the worst-case time complexity of the linear search algorithm?
O(log n)
O(n log n)
O(1)
O(n)
In the context of algorithm analysis, why are constant factors often ignored in asymptotic notations?
All of the above.
They become less relevant as the input size grows very large.
They are insignificant and have negligible impact on performance.
They are difficult to determine precisely and vary across different systems.