News for hackers. Stuff that matters.
Re:XOR Linked List by tresta on Thursday May 03, 2012 @06:33PM (#3926139)
Why wouldn't it?

A xor A = 0.

A xor 0 = A.

That should work like a regular circularly linked list or am I missing something?

edit

Doh, now I understand. If this was allowed it wouldn't be possible to have a one-node non-circular list.

Re:XOR Linked List by bbrtyth on Thursday May 03, 2012 @08:07PM (#3926407)
It would be the reverse case if it were non-circular, returning 0.
Re:XOR Linked List by ithkuil on Friday May 04, 2012 @03:05AM (#3927417)
You can encode "end of list" with another value like -1 which is usually safe since you can assume that addresses are at word aligned (so odd numbers cannot be addresses)