by Lars Vogel

Follow me on twitter

Lars Vogel on Google+

Complexity Analysis of Algorithms

Lars Vogel

Version 0.2

31.08.2009

Revision History
Revision 0.1 18.07.2009 Lars
Vogel
Created Article
Revision 0.2 31.08.2009 Lars
Vogel
Added description

Complexity Analysis

The following article describes the theoretical background on evaluating the performance of algorithms and programs.


Table of Contents

1. Introduction
2. The Big O notations
3. Thank you
4. Questions and Discussion
5. Links and Literature
5.1. Source Code
5.2. Resources
5.3. vogella Resources

1. Introduction

Choosing the fastest algorithm for a certain task require that that you can estimate the runtime of an algorithm.

The absolute runtime of an algorithm is determined by several things, for example:

  • The Hardware it is running upon

  • The programming language your are using

  • The compiler / runtime environment you are using

All these factors influence the actual runtime of a algorithm.

To compare the runtime behavior of algorithms is is important to have a mean to eliminate all these factors and to find a common description of the runtime.

2. The Big O notations

It is common practice to compare the runtime of algorithms by their asymptotic runtime via the Big O notation. This notations describes how the runtime depends on the number of input elements. It answers the question how much does the runtime increase if I double the number of input elements?

With this notation an algorithm is said to have a O(n) runtime if the runtime increases linear with the number of input elements. It has O(n^2) if the runtime increases quadratic, etc.

3. Thank you

Please help me to support this article:

Flattr this

4. Questions and Discussion

Before posting questions, please see the vogella FAQ. If you have questions or find an error in this article please use the www.vogella.de Google Group. I have created a short list how to create good questions which might also help you.

5. Links and Literature

5.1. Source Code

Source Code of Examples

5.2. Resources

http://en.wikipedia.org/wiki/Big_O_notation Big O Notation - Wiki

5.3. vogella Resources

Eclipse RCP Training (German) Eclipse RCP Training with Lars Vogel

Android Tutorial Introduction to Android Programming

GWT Tutorial Program in Java and compile to JavaScript and HTML

Eclipse RCP Tutorial Create native applications in Java

JUnit Tutorial Test your application

Git Tutorial Put everything you have under distributed version control system