You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to iterate from a given key to the end of the tree inclusively. But there seems to be no way to get the last (tree.Max()) value as part of that iteration. I don't know what the most elegant solution would be...
a bool param to IterRange that would change < @upper to <= @upper?
a new IterRangeInclusive that goes @lower <= E <= @upper?
telling me I should simply tack on tree.Max() when my IterRange chan returns a nil and I expect another element?
The text was updated successfully, but these errors were encountered:
I'm not yet entirely sure how to design the interface that controls inclusion/exclusion. One tempting possibility is to give a method to iterates from a given node (not item) to a given other node, inclusive. This is most general. To use it, you'd first "find" the nodes you need and then call the iterator. This will require some exposing the Node type, which is not terrible. I will think about this a bit. In the meantime, I've added IterRangeInclusive.
and the complementary IterDescendFrom... working exactly like the existing IterAscend but allowing you to specify a start item which is included in the iteration. Looking forward, IterAscend would then become:
I want to iterate from a given key to the end of the tree inclusively. But there seems to be no way to get the last (tree.Max()) value as part of that iteration. I don't know what the most elegant solution would be...
< @upper
to<= @upper
?@lower <= E <= @upper
?The text was updated successfully, but these errors were encountered: