this post was submitted on 15 Mar 2025
21 points (95.7% liked)
Rust
6697 readers
102 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
One note about doubly linked lists - I believe the received wisdom these days is that in almost all situations they're a bad algorithm to solve your problem. (I watched a video about it sometime... And read something in the Rust docs... I'm not an expert!)
I see other comments mentioning a hash map... Hopefully you've got some good options.
Linked lists in general are cache unfriendly, though it helps if you have a relocating GC that puts the nodes back in order. The hash map idea is a possibility. I'm not actually trying to implement something like this. It's more of a question about Rust's approach from a PL perspective.