Condense and extend std.Treap's traversal functionalities.
The core functionalities are now in two general functions extremeInSubtreeOnDirection() and nextOnDirection() so all the other traversing functions (getMin(), getMax(), and InorderIterator) are all just trivial calls to these core functions.
The added two functions Node.next() and Node.prev() are also just trivial calls to these.
I think the error come from me forgetting to zig fmt one file...
Can you add a test for getMin / getMax? This PR contains a compile error when using those functions (due to calling extremeInSubtreeOnDirection on self.root which is a ?*Node)
Can you add a test for
getMin/getMax? This PR contains a compile error when using those functions (due to callingextremeInSubtreeOnDirectiononself.rootwhich is a?*Node)
Done.
@squeek502 Quite a lot of code is not covered by your previous approval. Mind another look? Thanks.
@andrewrk This PR has no more action item for me.
Just to clarify that I added @nektro as reviewer to see whether she has more feedback after her initial comment. Given how many days passed, I'd count that as "no further comments".
Let me know if you have more comments, and if not, merge this PR. Thanks.
Pinging Andrew doesn't automatically prioritize your PR. There is a large PR backlog which ought to be dealt with first - himself or another Zig core team member will get to this PR in time.
@mlugg Sorry for the noise. Didn't know the status.
Sorry for the delayed merge and thank you for the nice patch.