
leetcode
yanhui~
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
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 · 259 阅读 · 0 评论 -
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 · 184 阅读 · 0 评论 -
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 · 158 阅读 · 0 评论