I'm trying to get into #rustlang. I've already rewritten a small program and it was an okay experience but today, I hit something weird.
I have a LinkedList and need to iterate over it and, if I found any item that meets some criteria, I need to remove it from the list.
Using C++ iterators, this would be O(N).
Rust's linked_list has an issue open for more than 4 years (!) to add a remove function to linked lists. But even with that function, you'll need an index of the item to be removed and cannot (as far as I can tell) use the iterator you already have from scanning the list.
So in Rust I would need to spend O(N) to scan the list and an additional O(N) for each item I need removed.
Or is there a faster way to do that?
Martin Bober
Als Antwort auf Martin Bober • •Achtung: Wie ich gerade sehe ist die heise-Meldung tatsächlich vom 30.12. Unklar, warum die jetzt von heise auf Mastodon gepusht wurde.
Tatsächlich ist man sich da in der Regierung wohl nocht nicht einig. golem.de/news/vorratsdatenspei…
Jerschte
Als Antwort auf Martin Bober • • •Martin Bober
Als Antwort auf Jerschte • •