How to find keys with given prefix in treemap by a high efficiency way ? #67
Labels
No labels
bug
discussion
documentation
duplicate
ignore
new feature
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
golibs/gms-gods#67
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
How to find keys with given prefix in a high efficiency way ?
Enumerable functions like "select" "find" has always to traverse all the treemap ?
that's correct, so that's not optimal.
it's better to find the nearest (or first) matching prefix in the tree and then traverse "left & right" in tree for as long as the prefix condition is satisfied and return those results.
that logic is not implemented in GoDS, but you do have access to all the nodes and could implement that custom functionality.