Big Oh Flashcards
1
Q
O(log(n))
A
narrows down the search by repeatedly halving the dataset until you find the target value.
2
Q
O(n)
A
performance becomes less efficient as data grows.
3
Q
Example of 2^n algorithm
A
recursive fibonacci: level 1 = 2^1, level 2 = 2^2, level 3 - 2^3 … etc
4
Q
Example of n! algorithm
A
recursive call of function with a for loop: when n = 3, level 1 = 3, level 2 = 2… or 3 * 2 * 1