What is the best-case time complexity of the insertion sort algorithm?
O(log n)
O(1)
O(n log n)
O(n)
Why is understanding time complexity crucial in algorithm analysis?
To compare the aesthetic quality of different algorithms
To determine the exact execution time of an algorithm
To calculate the cost of developing an algorithm
To predict how the performance of an algorithm scales with larger inputs
What does it mean if an algorithm has a time complexity of Ω(n log n)?
It runs in at most n log n time.
It runs in at least n log n time.
It runs in exactly n log n time.
It has a logarithmic growth rate.
Which of the following best describes the relationship between benchmarking and optimizing code for better time complexity?
Benchmarking is a type of optimization technique.
Benchmarking and optimization are independent processes.
Benchmarking is done after optimization to verify the improvements.
Optimization is done after benchmarking to identify areas for improvement.
Which of these Big-O notations represents the most efficient algorithm for large input sizes?
O(n^2)
Which of the following statements is TRUE regarding the trade-off between code optimization and readability?
Code readability is irrelevant as long as the code achieves optimal performance.
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.
Which data structure, when used for searching, can potentially improve the time complexity from O(n) to O(log n)?
Array
Queue
Linked List
Binary Tree
If an algorithm's time complexity is O(n^2), what can you conclude about its best-case time complexity?
It is Ω(n^2).
It is also O(n^2).
It is always constant, i.e., O(1).
It cannot be determined from the given information.
Which time complexity is characterized by an algorithm's runtime doubling with each additional input element?
O(2^n)
O(n!)
What is the worst-case time complexity of the linear search algorithm?