O: Difference between revisions

269 bytes added ,  15 years ago
Added ordered list of notations
(Algoritmic complexity notation)
 
(Added ordered list of notations)
Line 4:
 
Examples: searching in an unordered container of ''n'' elements has the complexity of O(''n''). Binary search in an ordered container with random element access is O(log ''n''). The term random access actually means that the complexity of access is constant, i.e. O(1).
 
Here are typical Big-O's listed slowest to fastest (that is, slower algorithms have Big-O's near the top):
*O(n<sup>n</sup>)
*O(n!)
*O(k<sup>n</sup>)
*O(n<sup>3</sup>)
*O(n<sup>2</sup>)
*O(n*log(n)) (fastest possible time for a comparison sort)
*O(n)
*O(log(n))
*O(1)
 
See also [http://en.wikipedia.org/wiki/Big_O_notation Big O notation]
Anonymous user