yes you are right from the middle of list you will not be able to traverse
the list unless you know the previous/next address
Here are the limitiation of XOR linked list:

This form of linked list may be inadvisable:

   - General-purpose debugging tools cannot follow the XOR chain, making
   debugging more difficult;
[1]<http://en.wikipedia.org/wiki/XOR_linked_list#cite_note-0>
   - The price for the decrease in memory usage is an increase in code
   complexity, making maintenance more expensive;
   - Most garbage
collection<http://en.wikipedia.org/wiki/Garbage_collection_(computer_science)>schemes
do not work with data structures that do not contain literal
   pointers <http://en.wikipedia.org/wiki/Pointer_(computing)>;
   - XOR of pointers is not defined in some contexts (e.g., the
C<http://en.wikipedia.org/wiki/C_(programming_language)>language),
although many languages provide some kind of type
   conversion <http://en.wikipedia.org/wiki/Type_conversion> between
   pointers and integers;
   - The pointers will be unreadable if one isn't traversing the list — for
   example, if the pointer to a list item was contained in another data
   structure;
   - *While traversing the list you need to remember the address of the
   previously accessed node in order to calculate the next node's address.*

Thanks,
Anand

On Wed, Jun 16, 2010 at 4:45 AM, Vivek Sundararajan <s.vivek.ra...@gmail.com
> wrote:

> so, this means that i can traverse the list only from the beginning of the
> link list right?
>
> what if im given a pointer pointing to some node other than the head of the
> doubly linked list? will i be able to traverse in any direction now?
>
> please let me know if im missing something :)
>
> Thank you,
> Vivek
>
>
> On 16 June 2010 15:37, divya jain <sweetdivya....@gmail.com> wrote:
>
>> u can xor linked list. such that every node link contains the xor of its
>> prev nd next node address.. since for 1st node prev is null ( 0) so its link
>> contains only next. now to calculate next of 2nd node xor its link with 1st
>> node's link nd u ll get 3 rd node.s adddress nd so on..
>>
>> u can also use sum. store in link the sum of prev node n next node
>> address.. bt this cn result in overflow. so xor method is better
>>
>>
>> On 16 June 2010 09:14, sharad kumar <sharad20073...@gmail.com> wrote:
>>
>>> u have to use XOR linked list
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algoge...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algoge...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
>   --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@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