We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
MedianOfRunningArray
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 implementation of MedianOfRunningArray has a bug.
The code:
MedianOfRunningArray p = new MedianOfRunningArray(); p.insert(30); p.insert(20); p.insert(10); System.out.print(p.median());
prints 10.
10
For such input, the output should be 20.
20
No response
MedianOfRunningArray p = new MedianOfRunningArray(); p.insert(10); p.insert(20); p.insert(30); System.out.print(p.median());
prints 20.
The text was updated successfully, but these errors were encountered:
TheAlgorithms#4382 Bug Fix
3b0ce38
6ed1189
#4382 Bug Fix (#4384)
fbe348b
* #4382 Bug Fix * #4382 Bug Fix * Made Requested Changes * Made Requested Changes * Made Requested Changes * Made Requested Changes * Made Requested Changes * Made Requested Changes * Made Requested Changes * Update src/main/java/com/thealgorithms/misc/MedianOfRunningArray.java Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com> * Update src/main/java/com/thealgorithms/misc/MedianOfRunningArray.java Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com> * Update src/test/java/com/thealgorithms/misc/MedianOfRunningArrayTest.java Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com> * Update src/test/java/com/thealgorithms/misc/MedianOfRunningArrayTest.java Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com> --------- Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
Closed by #4384.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Description
The implementation of
MedianOfRunningArray
has a bug.Steps to reproduce
The code:
prints
10
.Excepted behavior
For such input, the output should be
20
.Screenshots
No response
Additional context
The code:
prints
20
.The text was updated successfully, but these errors were encountered: