Big O notation Flashcards
Big O Constant Time (random access in array)
O(1) Constant Time
Big O Linear Time (Delete value linked List)
O(n) Linear Time (Looping Arrays, Lists)
What is Big O Notation
1) The efficiency of your Algorithm
2) Used to describe run-time characteristics of our data structure and algorithms
What is linear time
Where the number of elements in the data structure increased and the operation takes longer (looping, etc)
What is faster O(n) or O(2^n)
O(n)
Big O What is Logarithmic (search algorithms)
O(Log n) Logarithmic
Big O What is Quasilinear ( Sorting algorithms)
O(n log n) Quasilinear
Big O What is Quadratic (Nested Loops )
O(n powerOf 2) Quadratic
Exponential (Recursion, Fibonacci series) Gets slower the more that is calculated
O(2 powerOf n) Recursion,
Operations that takes the same amount of time regardless of the number of elements
O(1)
Iteration through a collection (for loop, while loop)
O(n)
Looping through the same collection x2 (nested)
O(n powerOf 2)
Fibonacci series - recursion (branches squared depth)
O(2 powerOf n)
Search sorted array (binary tree)
O(log n)
simplify O(n powerOf 2 + n)
O(n powerOf) Drop non-dominated terms