12 2014 档案

leetcode 【 Reverse Words in a String 】python 实现
摘要:题目:Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".代码:oj在线测试通过Runtime:172 ms 1... 阅读全文

posted @ 2014-12-27 00:12 承续缘 阅读(283) 评论(0) 推荐(0) 编辑

leetcode 【 Intersection of Two Linked Lists 】python 实现
摘要:题目:Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: ... 阅读全文

posted @ 2014-12-26 23:52 承续缘 阅读(668) 评论(0) 推荐(0) 编辑

leetcode 【Rotate List 】python 实现
摘要:题目: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 @ 2014-12-26 23:24 承续缘 阅读(245) 评论(0) 推荐(0) 编辑

leetcode 【 Linked List Cycle 】 python 实现
摘要:题目:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?代码:oj在线测试通过Runtime:416 ms 1 # Definitio... 阅读全文

posted @ 2014-12-26 15:53 承续缘 阅读(452) 评论(0) 推荐(0) 编辑

leetcode 【 Merge Two Sorted Lists 】 python 实现
摘要:题目:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.代码:oj在... 阅读全文

posted @ 2014-12-26 15:38 承续缘 阅读(1165) 评论(0) 推荐(0) 编辑

leetcode 【 Remove Duplicates from Sorted List II 】 python 实现
摘要:题目:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Given1->2-... 阅读全文

posted @ 2014-12-26 15:20 承续缘 阅读(707) 评论(0) 推荐(0) 编辑

leetcode 【 Remove Duplicates from Sorted List 】 python 实现
摘要:题目:Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, r... 阅读全文

posted @ 2014-12-26 14:33 承续缘 阅读(197) 评论(0) 推荐(0) 编辑

leetcode 【 Remove Nth Node From End of List 】 python 实现
摘要:题目: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 @ 2014-12-26 14:21 承续缘 阅读(205) 评论(0) 推荐(0) 编辑

leetcode 【 Linked List Swap Nodes in Pairs 】 python 实现
摘要:题目:Swap Nodes in PairsGiven a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list a... 阅读全文

posted @ 2014-12-26 13:39 承续缘 阅读(756) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示