-
206. Reverse Linked List javaLeetCode_Study_Plan/LeetCode 75 2022. 10. 5. 22:08
https://leetcode.com/problems/reverse-linked-list/?envType=study-plan&id=level-1
class Solution { public ListNode reverseList(ListNode head) { ListNode reversedNode = null; while(head != null){ ListNode tmp = head; head = head.next; tmp.next = reversedNode; reversedNode = tmp; } return reversedNode; } }
'LeetCode_Study_Plan > LeetCode 75' 카테고리의 다른 글
876. Middle of the Linked List java (0) 2022.10.05 21. Merge Two Sorted Lists java (0) 2022.10.05 392. Is Subsequence java (0) 2022.10.04 [LeetCode 75] 중간 점검 (0) 2022.10.02 205. Isomorphic Strings java (0) 2022.09.26