If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

First of all, if you read the forum's Etiquette you would know that we don't do homework assignments here, unless you show a real effort to solve the problem by yourself (which doesn't seem to be the case). Secondly, you need to define the loose terms: what's list->next exactly? Does it refer to thr first node of the list or to recentlt traversed node?
When you know the answer to this simple question, you'll be able to solve the rest of the exam. Simply take a pencil and follow the nodes according to the directions in the each question. It really isn't difficult.

Well, This is not a homework ! This is an exercise to improve my skills !
and I faced some difficulties in solving it because this is the first ADT course for me and even the Dr. didn't teach us doubly linked list ..

It seems that it is so easy to you ,But it is not so for me .. that is why I post it here .. to get a help !

Well, Mr. Danny ,
I think that it was better if you didn't reply in that way without any help not even a hint !We are here to learn from each other .. not to refuse helping each other !

---node( int d,node *ptr1=0,node *ptr2=0)
If this compiles, what is it supposed to do? You clear the pointers when you try
to create a node from good data? I am not sure what the result of this will be but it looks wrong ... Danny? ... consider his usage :

If its running without stopping and the only while loop is in the print statement, then remove the print first. If it still does not stop, you have a pointer problem and the app is hung (unlikely to to this without a crash). Let me know if removal of the print creates a program that stops.