They can also be used to easily build an optimal selection algorithm, as well as "near-sorting" algorithms, which are algorithms that place every element near its final position, a situation in which insertion sort is fast.