Created
July 10, 2020 11:56
-
-
Save vin18/045646505597e094bcecd03b807c9c03 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function to print a linked list | |
public static void printList(Node<Integer> head) { | |
if (head == null) { | |
return; | |
} | |
while (head != null) { | |
System.out.println(head.data); | |
head = head.next; | |
} | |
} | |
// Time Complexity: O(N) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment