Giter VIP home page Giter VIP logo

Comments (7)

LucaCappelletti94 avatar LucaCappelletti94 commented on July 26, 2024 1

Maybe it would be best to add a counter in the Map struct? Like in a Vec.

from trie-rs.

shanecelis avatar shanecelis commented on July 26, 2024

You could search for "" and count the iterator.

from trie-rs.

shanecelis avatar shanecelis commented on July 26, 2024

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.

LucaCappelletti94 avatar LucaCappelletti94 commented on July 26, 2024

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.

shanecelis avatar shanecelis commented on July 26, 2024

All right. Let's see it.

from trie-rs.

LucaCappelletti94 avatar LucaCappelletti94 commented on July 26, 2024

I will make a small pull request adding it after we finish merging #28

from trie-rs.

shanecelis avatar shanecelis commented on July 26, 2024

I've gone from hesitant to, "Yes, this is all good and makes sense."

from trie-rs.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.