擅长:python、mysql、java
<p>复杂的排序函数要简单得多,但也可以使用二进制排序。这可以通过使用lambdas来实现。在</p>
<p>请参阅以下链接了解实施细节:</p>
<p>1)<a href="https://stackoverflow.com/questions/11450277/complex-sort-with-multiple-parameters">Complex sort with multiple parameters?</a></p>
<p>2)<a href="https://stackoverflow.com/questions/3831449/advanced-sorting-criteria-for-a-list-of-nested-tuples">Advanced sorting criteria for a list of nested tuples</a></p>
<p>编辑:根据hivert的评论,你也可以使用itemgetter进行排序。实现细节如下:<a href="http://wiki.python.org/moin/HowTo/Sorting/#Sort_Stability_and_Complex_Sorts" rel="nofollow noreferrer">http://wiki.python.org/moin/HowTo/Sorting/#Sort_Stability_and_Complex_Sorts</a></p>
<p>选择更适合你的方法。在</p>