Does a “binary sort” algorithm exist?

前端 未结 8 1223
孤独总比滥情好
孤独总比滥情好 2021-01-07 21:59

Is there a sorting algorithm that is named \"binary sort\"? Like merge sort, selection sort, or the other kinds of sorting, does a binary sort exist?

8条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-07 22:46

    There's this and there's binary insertion sort. The two are pretty similar. They're both quadratic (O(n^2)) time algorithms.

    Both algorithms do O(n log n) number of comparisons, but in practice you would also have to move elements around, which would make the entire algorithm quadratic.

提交回复
热议问题