在遗传算法中出现等式约束
by Onel Harrison
通过Onel Harrison
排序算法中的稳定性-等式的处理 (Stability in Sorting Algorithms — A Treatment of Equality)
Algorithms are at the heart of computer science. Algorithms used for sorting are some of the most fundamental, useful, and consequently, ubiquitous.
算法是计算机科学的核心。 用于排序的算法是一些最基本,最有用且因此无所不在的算法。
Algorithm — a finite set of unambiguous steps for solving a specific problem.
算法-解决特定问题的有限的明确步骤集。
We constantly and often unconsciously sort and rely on the order of grouped objects. For instance, we rank tasks on a list according to priority. We stack books on shelves by their height. We sort rows in a spreadsheet or database, or rely on the alphabetical order of words in a dictionary. Sometimes, we even perceive a certain kind of beauty in ordered arrangements.
我们经常不知不觉地对分组对象的顺序进行排序和依赖。 例如,我们根据优先级在列表上对任务进行排名。 我们按书架的高度将书堆起来。 我们对电子表格或数据库中的行进行排序,或者依赖字典中单词的字母顺序。 有时,我们甚至有秩序地安排一种美感。
As programmers, knowing how we sort is important because it affects what a sorted arrangement might look like. Not all sorts order objects in the same way! Because of this, the results of sorting operations differ based on the algorithms used. If this goes unacknowledged, we might surprise ourselves or the people who use our software.
作为程序员,知道我们是如何排序是非常重要的,因为它影响的有序排列可能是什么样子。 并非所有对象都以相同的方式排序! 因此,根据所使用的算法,排序操作的结果会有所不同。 如果不了解这一点,我们可能会让自己或使用我们软件的人员感到惊讶。
The stability of sorting algorithms is one of the distinguishing properties among them. It deals with how the algorithm treats comparable items with equal sort keys.
排序算法的稳定性是它们之间