Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
reverse Linked List
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.*; import java.lang.*; class ListNode { int val; ListNode next; ListNode(int x) { val = x; } } class Rextester { public static void main(String args[]) { System.out.println("Hello, World!"); } public ListNode reverseList(ListNode head) { ListNode curr = head; ListNode prev = null; while(curr!=null){ ListNode tmp = curr.next; curr.next = prev; prev = curr; curr = tmp; } return prev; } }
run
|
edit
|
history
|
help
0
상속1
은행 입출금
Random and count of even numbers
Multiples of 3 and 5
Fibonnaci + Prime number combined
1*2-3+4
pow x^n
susun
String Palindrome
Bbs