Answers for "print circular linked list c++"

C++
-1

print circular linked list c++

/* Function to traverse a given Circular linked list and print nodes */
void printList(struct Node *first) 
{ 
    struct Node *temp = first;  
  
    // If linked list is not empty 
    if (first != NULL)  
    { 
        // Keep printing nodes till we reach the first node again 
        do
        { 
            printf("%d ", temp->data); 
            temp = temp->next; 
        } 
        while (temp != first); 
    } 
}
Posted by: Guest on October-26-2020

Code answers related to "print circular linked list c++"

Browse Popular Code Answers by Language