Print the Elements of a Linked List

  • + 0 comments

    Here's a solution in C#

    static void printLinkedList(SinglyLinkedListNode head) {
            while(head != null){
                Console.WriteLine(head.data);
                head = head.next;
            }
        }