-
Notifications
You must be signed in to change notification settings - Fork 0
ThanosSort Guide
github-actions[bot] edited this page Jun 15, 2026
·
2 revisions
ThanosSort 会反复随机删除一半元素,直到剩余结果有序。灭霸在此!
var values = new[] { 5, 1, 4, 4, 2, 3 };
var result = ThanosSorter.PruneUntilSorted(
values,
comparer: null,
removalStrategy: RemovalCountStrategy.CeilingHalf,
random: new Random(2026));- 它不是随机排序,而是随机删到有序。
- 幸存元素仍保持原有相对顺序。
- 固定随机种子时结果可复现。