插入排序(Insertion sort)

来源:互联网 发布:微店网络似乎存在问题 编辑:程序博客网 时间:2024/06/05 08:21
  • 算法描述:
    the list is divided into two sublists: sorted and unsorted.

Step1: move the first element of the unsorted list into the sorted list in the proper place.

Step2: repeat this process on the resulting list

  • 适用:list和linked list

  • 时间复杂度:the time required is O(n^2), it is proportional to n^2, where n is the number of data items in the array

  • 稳定性:stable
0 0