News for hackers. Stuff that matters.
Re:Microsoft changed how it interviews software developers by 13of40 on Sunday December 30, 2018 @03:23PM (#18791113)
No, I meant O(n) but used the wrong word for it.

Marking items visited can actually work, because on any(?) modern OS the memory for the elements in the list would be allocated at even addresses, meaning the low order bit of the Next pointer is always zero and can be reused as a marker.

Re:Microsoft changed how it interviews software developers by dmitrygr on Sunday December 30, 2018 @05:03PM (#18791624)
Your solution isn't thread safe :)
Re:Microsoft changed how it interviews software developers by 13of40 on Sunday December 30, 2018 @05:25PM (#18791717)
It's in a critical section. (Which you pretty much have to do with the canonical one too, since it can run off the rails if another thread modifies the list.)