1. Home
  2. Computing & Technology
  3. C / C++ / C#

Definition of Big-O

By David Bolton, About.com

Definition: Big - O Notation When measuring how fast algorithms perform, the Big-O notation is a handy way of stating the complexity of an algorithm (and how long it takes to run) according to the size of the input N. You would always expect that a sorting algorithm would take longer to sort 1,000 elements than 10. The question is "roughly how much longer?" This is what Big-O tells you. It is used by computer scientists to describe algorithms.

There are four commonly used Orders.

  • Linear. O(n)
  • Logarithmic. O(log(n)).
  • n-log-n. O(n * log(n))
  • Quadratic. O(n2).
An algorithm with linear running time is preferable to Logarithmic etc.

Glossary:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Examples: A simple loop which adds up the elements of an array would have Linear O(n) running time.

Explore C / C++ / C#

More from About.com

  1. Home
  2. Computing & Technology
  3. C / C++ / C#
  4. Glossary
  5. BIg-O Definition

©2008 About.com, a part of The New York Times Company.

All rights reserved.