根据原始索引排序的排序算法

Sort algorithm that sorts according to original index

做任何 sort algorithms 对给定的整数数组进行排序,如果 a[i]=a[j],则认为 a[i]>a[j] 如果 i>j?

排序算法定义了对输入进行排序的一般步骤。此类边缘情况将根据用户的要求由实际实现处理。

您可能正在寻找稳定 排序算法。稳定的排序算法维护具有相同键(即值)的记录的相对顺序。 概念解释 - https://en.wikipedia.org/wiki/Sorting_algorithm#Stability

稳定的算法 - https://en.wikipedia.org/wiki/Sorting_algorithm#Comparison_of_algorithms