Comparing Algorithms - Big O

From TRCCompSci - AQA Computer Science
Revision as of 12:00, 15 May 2017 by Ilostmylastaccount (talk | contribs) (Created page with "Big O Notation is a measure of how long or how much memory is needed to execute and algorithm. This uses the worst case scenario, so that you get the maximum time and memory u...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Big O Notation is a measure of how long or how much memory is needed to execute and algorithm. This uses the worst case scenario, so that you get the maximum time and memory usage. It uses n as the number of items.

Time complexities:

Constant complexity - O(1)
Linear complexity - O(n)
Logarithmic complexity - O(log n)
Linearithmic complexity - O(nlog n)
Polynomial complexity - O(n<superscript>k</superscript>)
Exponential complexity - O(k<super>n</super>)
Factorial complexity - O(n!)