zig icon indicating copy to clipboard operation
zig copied to clipboard

Condense and extend std.Treap's traversal functionalities.

Open jeru opened this issue 1 year ago • 7 comments

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.

jeru avatar May 19 '24 13:05 jeru

I think the error come from me forgetting to zig fmt one file...

jeru avatar May 19 '24 14:05 jeru

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)

ehaas avatar May 20 '24 21:05 ehaas

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)

Done.

jeru avatar May 20 '24 21:05 jeru

@squeek502 Quite a lot of code is not covered by your previous approval. Mind another look? Thanks.

jeru avatar May 21 '24 19:05 jeru

@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.

jeru avatar May 24 '24 17:05 jeru

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 avatar May 24 '24 18:05 mlugg

@mlugg Sorry for the noise. Didn't know the status.

jeru avatar May 24 '24 18:05 jeru

Sorry for the delayed merge and thank you for the nice patch.

andrewrk avatar Jul 29 '24 02:07 andrewrk