We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following input data:
arr := []int{65, 28, 59, 33, 21, 56, 22, 95, 50, 12, 90, 53, 28, 77, 39} pivot := 8 _ = quickselect.IntQuickSelect(arr, pivot)
reorders the data to the following:
[28 33 21 22 50 12 28 39 *59* 56 90 53 65 77 95]
As you can see, the value at index 8 (59) is higher than the 56 at index 9.
A correct example would be:
[21 12 22 33 28 28 39 50 53 56 59 65 90 77 95]
(as produces by https://github.com/keegancsmith/nth)
The text was updated successfully, but these errors were encountered:
This isn't a bug. Quickselect just selects 8 smallest elements and it does not guarantee anything about element at index 8.
Sorry, something went wrong.
No branches or pull requests
The following input data:
reorders the data to the following:
As you can see, the value at index 8 (59) is higher than the 56 at index 9.
A correct example would be:
(as produces by https://github.com/keegancsmith/nth)
The text was updated successfully, but these errors were encountered: