Answer to Question #276252 in C++ for zain

Question #276252

    Programming Problem I ( Singly Circular Linked List)

 

We are given a pointer to the first element of a linked list L. There are two possibilities for L, either it ends (snake) or it points back to head of the list (snail). Give a function that tests whether given list it is a snake or a snail. 


1
Expert's answer
2021-12-06T14:04:48-0500
void printList(Node* n)
{
    while (n != NULL) {
        cout << n->data << " ";
        n = n->next;
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment