2 ms·
They're roughly equal if the singly-linked list is just a head pointer, because the "each object is only reachable through a single path, which owns it" propert
by oconnor663 8y ago
They're roughly equal if the singly-linked list is just a head pointer, because the "each object is only reachable through a single path, which owns it" property means the compiler can reason about what's going on. It's when you add a tail pointer (or go whole hog and make it doubly-linked) that you lose that property and have to use unsafe code (or heavyweight things like Arc<Mutex<...>>) to get the compiler off your back.