gods
gods copied to clipboard
Request: add methods Min() and Max() to TreeSet
I see that TreeSet is
type Set struct {
tree *rbt.Tree
}
and rbt.Tree has Left() and Right() 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 grabbing arr[0] and arr[len(arr)-1] seems very wasteful.
Should be there now.