Open miparnisari opened 3 months ago
I see that TreeSet is
type Set struct { tree *rbt.Tree }
and rbt.Tree has Left() and Right() to get the min and max:
rbt.Tree
Left()
Right()
https://github.com/emirpasic/gods/blob/14f714261f50e6d3e4af1cd29e4ae11ffdedab94/trees/redblacktree/redblacktree.go#L196-L216
Can we expose those methods in the TreeSet too? The workaround of calling arr := treeset.Values() and then grabbing arr[0] and arr[len(arr)-1] seems very wasteful.
arr := treeset.Values()
arr[0]
arr[len(arr)-1]
Should be there now.
I see that TreeSet is
and
rbt.Tree
hasLeft()
andRight()
to get the min and max:https://github.com/emirpasic/gods/blob/14f714261f50e6d3e4af1cd29e4ae11ffdedab94/trees/redblacktree/redblacktree.go#L196-L216
Can we expose those methods in the TreeSet too? The workaround of calling
arr := treeset.Values()
and then grabbingarr[0]
andarr[len(arr)-1]
seems very wasteful.