Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

归并排序的哨兵代码有问题 #515

Open
eryou979 opened this issue Sep 9, 2021 · 0 comments
Open

归并排序的哨兵代码有问题 #515

eryou979 opened this issue Sep 9, 2021 · 0 comments

Comments

@eryou979
Copy link

eryou979 commented Sep 9, 2021

归并排序的哨兵代码有问题
测试数据:int[] ints = {1, 2, Integer.MAX_VALUE, Integer.MAX_VALUE}; 越界了
在最后面89行,判断大小改成小于号就可以,但是已经不是稳定排序了。。。
不知道我说的对不对
java/12_sorts/MergeSort.java
https://github.com/wangzheng0822/algo/blob/b2c1228ff915287ad7ebeae4355fa26854ea1557/java/12_sorts/MergeSort.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant