# 插入排序
class Insertion:
@staticmethod
def sort(a):
length = len(a)
i = 1
while i < length:
j = i
while j > 0 and a[j] < a[j-1]:
a[j], a[j-1] = a[j-1], a[j]
j -= 1
i += 1
# 调用demo
random_nums = [4, 2, 1, 0, 94]
Insertion.sort(random_nums)
print(random_nums)