What is the time complexity of inserting an element at the beginning of a singly linked list?
O(n log n)
O(n)
O(log n)
O(1)
What does it mean for an algorithm to have a time complexity of Θ(1)?
The algorithm's runtime is unpredictable and varies greatly with different inputs.
The algorithm is guaranteed to be the fastest possible solution for the problem.
The runtime grows linearly with the input size.
The runtime is constant and independent of the input size.
You have an algorithm with a time complexity of O(2^n). If you double the input size, how would you expect the execution time to be affected?
It remains roughly the same.
It increases by a factor of n.
It doubles.
It increases exponentially.
You have two algorithms for a task: Algorithm A with Θ(n) complexity and Algorithm B with O(n^2) complexity. Which statement is ALWAYS true?
It's impossible to compare the efficiency of the algorithms without knowing the exact implementation details.
Algorithm A will be faster than Algorithm B for all input sizes.
Algorithm B might be faster for very small input sizes, but Algorithm A will eventually be faster as input grows.
Algorithm A and Algorithm B have the same efficiency in terms of time complexity.
You need to design an algorithm that operates on a very large dataset. Which time complexity should you aim for to ensure reasonable performance?
O(n!)
O(2^n)
O(n^3)
If an algorithm has a time complexity of Ω(n log n), what can you conclude about its best-case runtime?
It will always be faster than an algorithm with O(n) time complexity.
It cannot be faster than an algorithm with O(log n) time complexity.
It will have a constant runtime regardless of input size.
It will always be slower than an algorithm with O(n^2) time complexity.
Which notation signifies that a function 'f(n)' grows strictly slower than another function 'g(n)' as 'n' approaches infinity?
Little-o (o)
Big-O (O)
Big Theta (Θ)
Big Omega (Ω)
What is the time complexity of searching for an element in an unsorted array of size 'n' in the worst-case scenario?
O(n^2)
A linear search algorithm iterates through an unsorted array to find a target element. What is its average-case time complexity?
O(n²)
Which of the following sorting algorithms has the best average-case time complexity?
Selection Sort
Bubble Sort
Merge Sort
Insertion Sort