Big 0 Notation Flashcards
(8 cards)
What are the two types of efficiency ?
Time Efficiency - how fast it runs,
Space Efficiency - how much memory it takes up.
How do we analyse efficiency ?
In terms of input size (n)
How do we measure running time ?
Using basic operations to keep analysis hardware-independent
What is the order of growth ?
O(1) - constant
O(log n) - logarithmic
O(n) - linear
O(n log n ) - linearithmic
O(n^2) - quadratic
O(n^3) - cubic
O(n!) - exponential (very inefficient)
What is the worst case ?
Longest time the algorithm can take.
What is the best case ?
The Shortest time the algorithm can take.
What is the average case ?
The expected time over random inputs.
What are the Asymptotic notations ?
Big O - upper bound (worst-case),
Big Omega (Ω) - lower bound (best case),
Big Theta (Θ) - tight bound (average case).