-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
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
Number of elements in trie #29
Comments
You could search for "" and count the iterator. |
Maybe it would be best to add a counter in the Map struct? Like in a Vec. |
I don't see the use case where knowing the size in O(1) time is worth it. You generally don't want to reify it, so it's not like you need to know to preallocate. Most searches will always be a different size but it would represent an upper bound. Is there a use case you had in mind? |
Generally speaking, I would expect the length of a set to be an O(1) complexity thing, especially since it only requires an usize. As a tradeoff time vs memory, it would seem worth it to me. |
All right. Let's see it. |
I will make a small pull request adding it after we finish merging #28 |
I've gone from hesitant to, "Yes, this is all good and makes sense." |
Hi, I am not sure whether there is a method in the trie that returns the number of elements in the trie. Is there?
The text was updated successfully, but these errors were encountered: