4 ms·
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 w
by 13of40 8y ago
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.