You are viewing a single comment's thread. Return to all comments →
Similar solution. You don't need the if statement for this problem though.
if(head == null){ System.out.print(""); } else{ Node current = head; while(current != null){ System.out.println(current.data); current = current.next;} }
Print the Elements of a Linked List
You are viewing a single comment's thread. Return to all comments →
Similar solution. You don't need the if statement for this problem though.