We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to get list for LowerBound and UpperBound ?
func Less(x, y treemap.Key) bool { return x.(uint32) < y.(uint32) } func GetIterator(iterator treemap.ForwardIterator) (keys []uint32, values []uint32) { for it := iterator; it.Valid(); it.Next() { keys = append(keys, it.Key().(uint32)) values = append(values, it.Value().(uint32)) } return } func TestSortedMap(t *testing.T) { testmap := treemap.New(Less) for i, v := range []uint32{10, 20, 30, 20, 15, 5} { testmap.Set(uint32(i+1), v) } level := uint32(2) keys1, _ := GetIterator(testmap.LowerBound(level)) keys2, _ := GetIterator(testmap.UpperBound(level)) t.Log("success") t.Log(keys1, keys2) }
keys1 return [2,3,4,5,6] keys2 return [3,4,5,6]
i hope keys1 return [1] , i try use it.Prev in GetIterator, but it.Valid isn't work in this case.
how can i use?
The text was updated successfully, but these errors were encountered:
i think the LowerBound api should response ReverseIterator
Sorry, something went wrong.
@ncw
Maybe @igrmk can help?
No branches or pull requests
how to get list for LowerBound and UpperBound ?
keys1 return [2,3,4,5,6]
keys2 return [3,4,5,6]
i hope keys1 return [1] , i try use it.Prev in GetIterator, but it.Valid isn't work in this case.
how can i use?
The text was updated successfully, but these errors were encountered: