No student devices needed. Know more
26 questions
Indicate constant time complexity in terms of Big-O notation
O(n)
O(1)
O(log n)
O (n^2)
Indicate exponential time complexity in terms of big-O notation
O (n)
O (n^2)
O (2^n)
O (log n)
Find the slowest time complexity
O (n)
O (n^2)
O (n!)
O (2^n)
Which notation is consistent for every execution?
O (n)
O (n^2)
O (1)
O (2^n)
The O (n!) is so inefficient, there is no practical use for it
True
False
Which notation grows in proportion to the size of the input
O (n)
O (n^2)
O (1)
O (2^n)
Which notation would you usually use for a nested loop?
O (n)
O (n^2)
O (1)
O (2^n)
Indicate polynomial time complexity in terms of big-O notation
O (n!)
O (1)
O (n^2)
O (log n)
Big-O is used to identify the most ____ algorithm for a specific purpose
When calculating the Big-O for an algorithm, which of the following rules is not true?
Focus on the dominant term
Disregard any constants
Focus only on polynomials
Count the number of assignments
Big-O notations tell you how long the algorithm will take to complete in standard time
True
False
Identify the dominant term in the following algorithm
n2
n3
Identify the dominant term in the following algorithm
n2
n
The number of executions grows extremely quickly as the size of the input increases
Exponential Time
Linear Time
Polynomial Time
Constant Time
The number of executions grows in proportion to the size of the input
Exponential Time
Linear Time
Polynomial Time
Constant Time
The number of executions remains the same regardless of the input size
Exponential Time
Linear Time
Polynomial Time
Constant Time
The number of executions grows quickly by the input being multiplied by the input
Exponential Time
Linear Time
Polynomial Time
Constant Time
No matter how large the input is, the time taken doesn’t change.
Quadratic
Linear
Logarithmic
Constant
Linearithmic
For every element, you are doing a constant number of operations, such as comparing each element to a known value.
Quadratic
Linear
Logarithmic
Constant
Exponential
When calculating the time complexity of an algorithm, you must focus only on the ____ term
Big-O is used to calculate the ____ case runtime for an algorithm
The time complexity of an algorithm indicates how much time an algorithm will take to complete
True
False
O n2 is the worst case scenario for
Merge Sort
Bubble Sort
Binary Search
Linear Search
O (n log n) is the worst case scenario for
Merge Sort
Bubble Sort
Binary Search
Linear Search
O n is the worst case scenario for a ___ ____ algorithm
O log n is the worst case scenario for a ___ ____ algorithm
Explore all questions with a free account