Print the Elements of a Linked List

  • + 0 comments

    cpp

    void printLinkedList(SinglyLinkedListNode* head) {
    
        auto current = head;
    		while(current){
            std::cout << current->data << std::endl;
            current = current->next;
        }
        
    }