展示HN:MinMAX排序 - 一种稳定的双向选择排序家族算法
仓库:<a href="https://github.com/tsuJack-Devs/minMAX-Sorting-Algorithm/tree/main" rel="nofollow">https://github.com/tsuJack-Devs/minMAX-Sorting-Algorithm/tree/main</a>
去年出于好奇和兴趣,我制作了一个排序算法,没想到这实际上是选择排序的一种变体。它仍然包含外层循环和内层循环,但操作次数比传统的选择排序或 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