Print the Elements of a Linked List

  • + 0 comments

    Here is my c++ solution, you can watch the explanation here : https://youtu.be/t3gCqS1F24w

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