展示 HN:MinMAX Sort – 一种稳定的双向选择排序家族算法
1 分•作者: jodenghog•5 天前
代码库:https://github.com/tsuJack-Devs/minMAX-Sorting-Algorithm/tree/main
去年我出于好奇和爱好写了一个排序算法,当时并不知道它实际上是选择排序的一个变种。它仍然有外层循环和内层循环,但操作次数比传统选择排序或 O(n^2) 排序算法变种少一半。外层循环减少了 n/2,内层循环也减少了 (n x n)/2。该算法已经过大量数字排列的测试,包括波峰、波谷、反序、重复以及任何可能的混乱数组。推广一个改进的选择排序算法听起来有点疯狂,但确实是我出于对计算机科学的热情而创造的。
:D
查看原文
Repository: <a href="https://github.com/tsuJack-Devs/minMAX-Sorting-Algorithm/tree/main" rel="nofollow">https://github.com/tsuJack-Devs/minMAX-Sorting-Algorithm/tre...</a>
I made a sorting algorithm last year out of curiosity and hobby not knowing that this was actually a selection sort variant. It still has outer and inner loop but, half of the operations than the traditional selection sort or O(n^2) sorting algorithm variants. Making outer loop n/2 smaller and inner loop is (n x n)/2 smaller as well. This is well tested with a lot of number arrangements like cliff, spike, reverse, duplicates, and any possible chaotic array of numbers. Kinda crazy to promoting an improved selection sort algorithm but yeah, made it with passion of CS.
:D