www.hackerrank.com/challenges/print-the-elements-of-a-linked-list/problem
package exam.complete; import exam.SinglyLinkedListNode; //https://www.hackerrank.com/challenges/print-the-elements-of-a-linked-list/problem public class PrintLinkedList { static void printLinkedList(SinglyLinkedListNode head) { while(head != null) { System.out.println(head.data); head = head.next; } } }
'Programming > Data Structure' 카테고리의 다른 글
[Hackerrank] Reversealinkedlist (0) | 2020.12.02 |
---|---|
[Hackerrank] ReverseADoublyLinkedList (0) | 2020.12.02 |
[Hackerrank] MergeTwoSortedLinkedLists (0) | 2020.12.02 |
[Hackerrank] MatchingStrings (0) | 2020.12.02 |
[Hackerrank] InsertNodeAtTail (0) | 2020.12.02 |