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

Is there a fault in heap_sort? #1036

Open
Jiangluyu opened this issue Mar 4, 2020 · 1 comment
Open

Is there a fault in heap_sort? #1036

Jiangluyu opened this issue Mar 4, 2020 · 1 comment

Comments

@Jiangluyu
Copy link

I have prudently went through the source code, but I found a problem(maybe) when I use the following data: {42, 20, 17, 13, 28, 14, 23, 15}, I think there are other WRONG data like this. In my opinion, that's because in the last sort loop, the arr is 28 42 23 20 17 15 14 13, and the heap left is 28 42, so it does not satisfy the condition to swap 28 & 42, but actually 28 42 is not in the right order.

@anishsingh935
Copy link

can I fix this issues please

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

2 participants