Print the Elements of a Linked List

  • + 0 comments

    Here is my c++ solution:

    void printLinkedList(SinglyLinkedListNode* head) {
        for ( ; head != NULL; head = head->next)
        {
            cout << head->data << endl;
        }
    }