Skip to content
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

Isn't the time complexity a little high, when for (auto x : m) { ... }? #10

Open
daidai21 opened this issue Feb 18, 2021 · 0 comments
Open

Comments

@daidai21
Copy link

Isn't the time complexity a little high, when for (auto x : m) { ... }? One iteration calls fifo_map_compare n^2 times.

I think the time complexity of such a structure can be lower:

  • one map: {Key, Value is pointer to node of queue}
  • one queue: fifo, node{key, value}

For loop just iterates through the queue.

Looking forward to your reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant