-
Notifications
You must be signed in to change notification settings - Fork 253
Add a priority queue based on finger trees #279
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
Conversation
… max for pqueue's
core/src/main/java/fj/data/List.java
Outdated
| final A y = ys.head(); | ||
|
|
||
| if (o.isLessThan(x, y)) { | ||
| if (o.isLessThan(x, y) || o.eq(x, y)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a isLessThanOrEqualTo to Ord would be useful to avoid doing the comparison twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I have pushed this change.
| Stream<Integer> s = ft.toStream(); | ||
| System.out.println(s.toList()); | ||
|
|
||
| out.println(midPriorityQueue()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing asserts?
(same for split)
Also commented code and println calls should probably be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was playing with the code to understand what was happening. Removed.
also improved isLessThanOrEqualTo and simplified Ord instances of Comparable types.
+ some other minor refactoring.
Improvements for functionaljava/functionaljava#279
|
I have merged these and addressed each of these issues. Do you think it is ready to merge into the Functional Java master branch? I am too close to the code now and find it hard to spot the errors/improvements. |
|
@mperry yep, look good to me! |
No description provided.