This is very language-dependent.  In assembly it's no problem at all!
In C you must coerce to an integer type where xor is possible.

The portable way to make this work including 64-bit systems is to use
type uintptr_t from stdint.h.  Not all compilers have this.

Perhaps the next best hing to try is size_t, which is declated in
stdlib.h .  However this is not guarenteed to be big enough.  It will
probably work on most systems however.

So you'd compute the xor of two pointers p and q with:

size_t xored_pointers = (size_t)p ^ (size_t)q;

On Nov 24, 3:07 pm, kumar raja <rajkumar.cs...@gmail.com> wrote:
> http://en.wikipedia.org/wiki/XOR_linked_list
>
> In this link i have seen about Xor linked list ,but my doubt is how will u
> perform xor on Address of nodes.
>
> I have tried to perform xor on addresses of two values ,so how is it
> possible to use that technique.
>
> Also tell me whether there are any extra rules to follow during
> insert,delete and search
> --
> Regards
> Kumar Raja
> M.Tech(SIT)
> IIT Kharagpur,
> 10it60...@iitkgp.ac.in

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to