- 博客(3)
- 收藏
- 关注
原创 LeetCode:Reverse Nodes in k-Group Java实现
LeetCode题目:Reverse Nodes in k-Group 题目概述 Given this linked list: 1->2->3->4->5 For k = 2, you should return: 2->1->4->3->5 For k = 3, you should return: 3->2->1->4-&g...
2019-04-10 21:22:43
256
原创 LeetCode:Swap Nodes in Pairs Java实现
LeetCode题目:Swap Nodes in Pairs 题目概述 Given 1->2->3->4, Return 2->1->4->3. 解题方法 迭代 public ListNode swapPairs(ListNode head) { if (head==null || head.next==null) { return head; ...
2019-04-08 11:49:21
157
原创 LeetCode:Reverse Linked List Java实现
LeetCode题目:reverse linked list 题目概述: Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL 解题方法 迭代: public ListNode reverseList(ListNode head) { if (head==nul...
2019-04-08 11:02:08
181
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人