top | item 3926139

(no title)

tresta | 14 years ago

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.

discuss

order

bbrtyth|14 years ago

It would be the reverse case if it were non-circular, returning 0.

ithkuil|14 years ago

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)