上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 28 下一页

2015年4月30日

摘要: 题目:Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?... 阅读全文
posted @ 2015-04-30 23:55 承续缘 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?代码:用hashmap版/** * Definition for singly... 阅读全文
posted @ 2015-04-30 23:21 承续缘 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 题目:A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep co... 阅读全文
posted @ 2015-04-30 15:40 承续缘 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a multiple ofkthen lef... 阅读全文
posted @ 2015-04-30 10:42 承续缘 阅读(247) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your al... 阅读全文
posted @ 2015-04-30 09:41 承续缘 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After... 阅读全文
posted @ 2015-04-30 09:16 承续缘 阅读(203) 评论(0) 推荐(0) 编辑

2015年4月29日

摘要: 题目:Given a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL.代码... 阅读全文
posted @ 2015-04-29 23:10 承续缘 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Given1->2-... 阅读全文
posted @ 2015-04-29 19:19 承续缘 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the or... 阅读全文
posted @ 2015-04-29 09:32 承续缘 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 题目:Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NULL... 阅读全文
posted @ 2015-04-29 08:58 承续缘 阅读(176) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 28 下一页

导航