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

sorted map #9

Open
rdp opened this issue Oct 15, 2018 · 1 comment
Open

sorted map #9

rdp opened this issue Oct 15, 2018 · 1 comment

Comments

@rdp
Copy link

rdp commented Oct 15, 2018

Might be nice. Though I don't, heh, like "need it today" as it were. Either sorted by insertion or by a key. And possibly some other structures that clojure has as well would be nice: https://clojure.org/reference/data_structures#Vectors thanks for the library!

@lucaong
Copy link
Owner

lucaong commented Nov 28, 2018

Hi! Sorry for the late response. Yes, I agree more data structures would be useful. Immutable List would be quite easy to add, although I suspect Vector would be preferable in most situations. Set can be implemented on top of Map. Sorted maps by insertion order like Clojure's ArrayMap are also quite simple, and can be implemented on top of Vector, but their performance is linear, so they are only ideal for small collections. Sorted maps sorted by key could be implemented as trees, with logarithmic lookup/insertion complexity.

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

2 participants