
链表
文章平均质量分 79
Coding_Reading
待我编码有成 娶你为妻可好
展开
-
leetcode92. Reverse Linked List II
medium程度题目:Reverse a linked list from position m to n. Do it in-place and in one-pass.For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->5->NULL.Note:Giv原创 2017-04-12 22:15:08 · 407 阅读 · 0 评论 -
leetcode25. Reverse Nodes in k-Group
Hard程度题题目:Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.k is a positive integer and is less than or equal to the length of the linked lis原创 2017-04-20 15:20:49 · 443 阅读 · 0 评论 -
leetcode141. Linked List Cycle
easy程度题题目:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?可以建立一个set集合,每次访问一个新节点,如果集合中没有则将节点放入set,如果有则说明存在环。不占用额外空间,想不出来原创 2017-04-22 10:18:07 · 353 阅读 · 0 评论 -
leetcode143. Reorder List
medium程度题题目:Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For example,Given {1,2,原创 2017-04-22 12:53:52 · 328 阅读 · 0 评论