linkedList print nodes method
Linked List Print Nodes Method
If you are working with linked lists, you will often need to print the nodes in the list. This can be done using a print nodes method that iterates through the list and prints the data of each node. The method should take the head