linked_list/linked_list1.cpp
// 1 iterative method
// displays the data of the nodes
1 iterative method
displays the data of the nodes
1 iterative method displays the data of the nodes
void display(struct Node *p)
{
    while (p != NULL)
    {
        printf("%d \n", p->data);
        p = p -> next;
    }
}
void display ( struct Node * p ) { while ( p != NULL ) { printf ( " \n " , p -> data ) ; p = p -> next ; } }
1 iterative method
displays the data of the nodes
1 iterative method displays the data of the nodes
// traverse through the linked list // as long as we reach the last node