Big O notation

From NoskeWiki
Revision as of 06:36, 23 September 2023 by NoskeWiki (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

About

NOTE: This page is a daughter page of: Programming interviews


Big O notation helps classify the running time and space requirements of algorithms based on how they they respond to input size (n). I learnt big O notation back in first year undergraduate, but occasionally forget the names of different notations, hence I've added the table below to remind me:


Big O notation

Notation Name
O(1) constant
O(log n) logarithmic ... or "linearithmic" for O(n log n)
O(n) linear
O(n2) quadratic
O(nc) * polynomial
O(cn) * exponential
O(n!) * factorial

> * = where c>1


Links