Insertion sort
Sorting algorithm that, at each iteration, inserts the current input element into the suitable position between the already sorted elements
Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time by comparisons. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort.
Nº Q117241 ★★
Uncommon · Knowledge
Insertion sort
Sorting algorithm that, at each iteration, inserts the current input element into the suitable position between the already sorted elements
Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time by comparisons. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort.
Last price
—
Floor price
—
7-day median
—
30-day sales
0
30-day range
—
In circulation
0
Price history
median
low – high
sales
No sales in this period
Show table
| Date | median | Low | High | sales |
|---|
Sales history
- Last sale
- —
- 30-day average
- —
- 30-day low
- —
- 30-day high
- —
- Sales 7d
- 0
- Sales 30d
- 0
No sales yet.
Anonymous sales: no buyer or seller shown. Figures count player-to-player sales only.
From Wikipedia
Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time by comparisons. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort. However, insertion sort provides several advantages: Simple implementation: Jon Bentley shows a version that is three lines in C-like pseudo-code, and five lines when optimized. Efficient for (quite) small data sets, much like other quadratic (i.e., O(n2)) sorting algorithms May be more efficient in practice than most other simple quadratic algorithms such as selection sort or bubble sort – but relative incoming data order and read/write costs matter – with high exchange costs and randomly ordered data, selection sort is faster Adaptive, i.e., efficient for data sets that are already substantially sorted: the time complexity is O(kn) when each element in the input is no more than k places away from its sorted position Stable; i.e., does not change the relative order of elements with equal keys In-place; i.e., only requires a constant amount O(1) of additional memory space Online; i.e., can sort a list as it receives it When people manually sort cards in a bridge hand, most use a method that is similar to insertion sort.
Text: Wikipédia, CC BY-SA 4.0. · Image: Nuno Nogueira (Nmnogueira) (CC BY-SA 2.5) ·
Related cards
Bubble sort
Simple sorting algorithm
Nº Q60864 ★★★
Radix sort
Non-comparative sorting algorithm
Nº Q830223 ★★
Heapsort
Worst-case optimal in-place comparison sorting algorithm based on the heap data structure
Nº Q474095 ★★
Counting sort
Sorting algorithm
Nº Q1124964 ★
Topological sorting
An ordering of the vertices of the directed graph for which each edge is directed from earlier to later in the ordering
Nº Q753127 ★★★
Integer overflow
In programming, a condition that occurs when an arithmetic operation attempts to create a numeric value that is outside of the range that can be represented with a given number of digits
Nº Q1423448 ★★