Implement double linked list with using only 1 pointer variable in list node?

India
January 19, 2007 1:03am CST
Hi All, As I promised you, I am here again with a new challenging puzzle in c/c++. Puzzle: How will you implement double linked list with using only 1 pointer variable in list node. For example the node of the link list is like; struct node { int data; struct node *next; }; I Hope, all of you will like this puzzle.
1 response
• India
19 Jan 07
This is a challenging puzzle. I do have an answer but i think it is a stupid one. I almost lost touch with data structures in C since i dint ever had to use it after my college. Anyway i would like to know the answer to this and would come back regularly for the answer. Anyway this is a very informative thread. Maheshwari (I hope thats your name) please do post the answer if no one could post the correct one.
• India
19 Jan 07
Hi swaroop (i hope thats your name), thanks for your reply. Believe me, its not a stupid question and i know at least one solution. I just want to start such discussion so that people can particpate and knowledge can be distributed or transfed from people to people. Ofcourse, i will post the answer if i could not found any discussion on this topic. But i hope, people at least can try to solve this puzzle. If it is really hard, i will post some light puzzle. Thanks for your reply. :)
• India
19 Jan 07
I dint mean your question was stupid. I meant the answer which is in my mind is stupid. Sorry for the confusion. :)
• India
21 Jan 07
Hi Swaroop, no need to say sorry.. nothing was wrong.. and we had a good discussion... no probs at all... u r most welcome to comments... :)