Print the Elements of a Linked List

  • + 0 comments

    Here is my c++ solution in simple way , you can watch the explanation

     SinglyLinkedListNode* temp=head;
        while(temp!=nullptr){
            cout<<temp->data<<"\n";
            temp=temp->next;
        }