DataStructures and macros discussion #4
SamuraiCrow
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
About 2 weeks ago I forked the dsa_rust project from @aniketfuryrocks and decided to try to make an improved version of the singly-linked-list. I'm not sure I will completely finish it because the references that the iterators point to are inherantly unsafe because nodes can be deleted at any given point in a multithreaded environment. (Maybe I need a mutex somewhere?) Anyway what I want to show and tell is here and doesn't compile yet.
What I hoped to prove was that if the reference to the last node of the list was maintained as an iterator, new nodes could be inserted at the end and removed from the beginning, making a perfectly growable circular queue. Also, the time complexity of both insert and remove with such a linked-list is always O(1).
That's what I wanted to show and tell and just wish it could have been as a pull request rather than a discussion post.
Beta Was this translation helpful? Give feedback.
All reactions