# include
Struct list
{
int number;
Struct list * next;
Previous struct list *;
} the head, * node;
Void main ()
{
int i;
Head. Next=NULL;
Head. Previous=NULL;
The node=& amp; The head;
for(i=1; i<=10; I++)
{
Node - & gt; Next=(struct list *) malloc (sizeof (struct list));
Node - & gt; Next - & gt; Previous=node;
The node=node - & gt; Next;
Node - & gt; Number=I;
Node - & gt; Next=NULL;
}
The node=head. The next;//print
Do
{
Printf (" % d ", node - & gt; Number);
The node=node - & gt; Next;
} while (node);
The node=node - & gt; Previous;
Do
{
Printf (" % d ", node - & gt; Number);
The node=node - & gt; Previous;
} while (node - & gt; Previous);
}
CodePudding user response:
Do{
Printf (" % d ", node - & gt; Number);
The node=node - & gt; Next;
} while (node);
The node=node - & gt; Previous;//the right value of the node==NULL
CodePudding user response: