跳至主要內容
插入排序 Insertion sort

插入排序 Insertion sort

原理

先看看Wikipedia的定义:

Insertion sort algorithm iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration removes one element from the input data, finds the location it belongs within the sorted list, and inserts it there. It repeats until no input elements remain.


莫林...大约 3 分钟数据结构与算法插入排序排序Javascript