2 ms·
That's a great idea. I had another approach that assumed the entry addresses were aligned to 32/64 bit words in memory as structure's by default are. Then the n
by jamesmiller5 12y ago
That's a great idea. I had another approach that assumed the entry addresses were aligned to 32/64 bit words in memory as structure's by default are. Then the next pointers will never have the ones or twos bit place set and can be used as a visited marker[1]. This gives a O(n) with a much smaller constant factor than the hair and tortoise.
1.https://www.cs.purdue.edu/homes/cs240/lectures/Lecture-7.pdf https://www.cs.purdue.edu/homes/cs240/lectures/Lecture-7.pdf