Tim Harris’ singly linked list turned out to be more complicated than I had realised – it has helping. If during a list traversal you bump into a logically deleted element, you help; you perform the physical delete.
I think I’m going for the first time to add a dummy head element; it allows easy use of functions in the main behaviour loops, whereas otherwise you end up writing everything in one big lump (because list_state->head is a special case, where you find the first element has its delete bit set, as you need to change list_state->head rather than list_element->next).
0 Comments.