类似拿牌:
数组 A;
for j <- 2-length[A] key = A[j] i = j-i; while i>0 and A[i]>key //j从2-lenth[A],依次变例j-1->0数组元素,然后后移,直到发现比j小的,将j插入后一个位置。 A[i+1] = A[i]; i--; A[i+1] = key;
时间复杂度 o(n的平方)