1. Computing & Technology

Discuss in my forum

Definition of Big-O

By , About.com Guide

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.

©2012 About.com. All rights reserved.

A part of The New York Times Company.