Comments (7)
Maybe it would be best to add a counter in the Map struct? Like in a Vec.
from trie-rs.
You could search for "" and count the iterator.
from trie-rs.
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?
from trie-rs.
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.
from trie-rs.
All right. Let's see it.
from trie-rs.
I will make a small pull request adding it after we finish merging #28
from trie-rs.
I've gone from hesitant to, "Yes, this is all good and makes sense."
from trie-rs.
Related Issues (13)
- Too many unwrap()s
- Slow predictive_search() compared to common_prefix_search() HOT 2
- Benchmark: print memory footprint compared to original `edict.furigana` file HOT 1
- ability to clone Tries? HOT 2
- Serde support
- Switching from Travis to Github Actions HOT 1
- private type `KeyValue<K, V>` in public interface HOT 1
- Change source of GitHub pages HOT 2
- Reduce memory usage
- Map values dropped if longer path is added first HOT 4
- Serialization/deserialization not working properly HOT 2
- Getting direct children of a node
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trie-rs.