Traverse the Doubly Linked list by R4R Team

Traverse in Forward Direction:

void traverse()
{
struct node *ptr;
ptr=first;
while(ptr!=NULL){
printf("%d ",ptr->data);
ptr=ptr->next;
}
}

Traverse in Reverse Direction:

void traverse()
{
struct node *ptr;
ptr=last;
while(ptr!=NULL){
printf("%d ",ptr->data);
ptr=ptr->pre;
}
}




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!