[Home]
InsertionSort

| CodeRaptors | Projects | Tips and Scripts | Guides | Links |


Each colored bar represents a list element. The height and color correspond to the value of the element. The green bar signals a read operation and the blue one a write operation.

Virtual time is a rough estimate of the algorithm speed. It can be used to compare the different algorithms on this website, but it's not really a good benchmark. The actual running time of the applet is not related to the virtual time and says nothing about the speed of the algorithm, it is trimmed to make the slower ones bearable to watch and the faster ones possible to see.

This algorithm is simple to understand and implement but has complexity O(n^2). It is however often faster in practice than other O(n^2) sorting algorithms and is particularly fast on almost sorted lists. It can be effectively used for on-line sorting, where elements are received one at a time.

More on Insertion sort here.

<< Go back to the sorting algorithms



Search: