1

Topic: Two pointers in one word by means of XOR

Reading the book "Coders behind operation. Speculations about craft of the programmer", came across a phrase: the Trick with saving in one word of two pointers by means of operation XOR... Dinosaurs, explain, please, that for a trick?

2

Re: Two pointers in one word by means of XOR

Hello, Mihas, you wrote: M> that for a trick? For example https://en.wikipedia.org/wiki/XOR_linked_list

3

Re: Two pointers in one word by means of XOR

Hello, watchmaker, you wrote: M>> that for a trick? W> for example https://en.wikipedia.org/wiki/XOR_linked_list the Trick not interesting, and here structure interesting. Having the pointer on node I cannot derive it, it is necessary two pointers? The structure is used in cases when pointers on elements much less than elements in sheet, so?

4

Re: Two pointers in one word by means of XOR

Hello, Videoman, you wrote: V> Having the pointer on node I cannot derive it, it is necessary two pointers? Not so. You can not pass to the following, without having the pointer on the previous. V> the structure is used in cases when pointers on elements much less than elements in sheet, so? In my opinion, simple saving of storage.