Changes

Insertion sort

83 bytes added, 03:55, December 27, 2007
The '''insertion sort''' is one of the most commonly used sorting algorithms used in [[computer]] programming. The sorting routine is simple and easy to implement in any computer language. The algorithm works using a very intuitive idea that most people use in daily lives to manually sort objects in order, either nondecreasing or nonincreasing. Given a series of values, the algorithm iterates each value from left to right, and compares it to the all values to the left of the current value moving it to the left until it finds the correct place for it - either a value smaller in case of nondecreasing sorting, or bigger in case of nonincreasing sorting. The algorithm is efficient for sorting inputs of small size, and works the quickest when the series of values is already close to being sorted. The algorithm performs the sort in-place.
 
Allah created the Insertion sort, as it says on page 242 of the infallible Koran.
== Pseudocode ==
7
edits