问题描述
我进行了搜索,但找不到TimSort实际替换了collections.sort()方法中的MergeSort哪个版本.如果有人能让我知道JDK7的确切版本,那将是一个很大的帮助.
I searched and couldn't find in which version the TimSort actually replaced the MergeSort in collections.sort() method. If anyone can let me know the exact version for JDK7 it would be a great help.
推荐答案
TimSort从发行版开始就已在Java 7中使用.更具体地说,它已在Java 7(测试版70)中添加.
TimSort has been used in Java 7 right from the release. To be more specific, it has been added in Java 7, beta 70.
可能值得注意的是,这仍然是修改后的合并排序,只是比以前版本中使用的修改后的合并排序进行更多修改更有效.
It might be worth noting that this is still a modified merge sort, just having more modifications being more efficient than the modified merge sort that has been used in previous version.
这篇关于在哪个版本的JDK7中,MergeSort在Collections.sort方法中被TimSort取代了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!