码迷,mamicode.com
首页 >  
搜索关键字:实现题    ( 337个结果
SICP~计算机程序的构造和解释~ 1.12 c++实现
题目: 采用递归计算过程计算出帕斯卡三角形的各个元素。row:0 11 1 12 1 2 13 1 3 3 14 1 4 6 4 15 . . . . . .col: 0 1 2 3 4//c++//递归#includeusing namespace std;int pascaler(int row...
分类:编程语言   时间:2015-01-14 14:10:10    阅读次数:177
leetcode 【 Convert Sorted List to Binary Search Tree 】python 实现
题目:Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.代码:oj测试通过Runtime:178 ms 1 # Definition...
分类:编程语言   时间:2015-01-11 20:18:51    阅读次数:235
leetcode 【 Copy List with Random Pointer 】 python 实现
题目: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...
分类:编程语言   时间:2015-01-11 17:39:30    阅读次数:178
leetcode 【 Partition List 】python 实现
题目: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...
分类:编程语言   时间:2015-01-10 12:25:37    阅读次数:204
leetcode 【 Swap Nodes in Pairs 】python 实现
题目: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...
分类:编程语言   时间:2015-01-10 00:57:36    阅读次数:327
leetcode 【 Reorder List 】python 实现
题目:Given a singly linked listL: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 e...
分类:编程语言   时间:2015-01-09 23:44:17    阅读次数:237
leetcode 【 Reverse Linked List II 】 python 实现
题目: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...
分类:编程语言   时间:2015-01-09 00:09:55    阅读次数:301
leetcode 【 Sort List 】 python 实现
题目:Sort a linked list inO(nlogn) time using constant space complexity.代码:oj 测试通过Runtime:372 ms 1 # Definition for singly-linked list. 2 # class ListNo...
分类:编程语言   时间:2015-01-08 19:37:40    阅读次数:195
leetcode 【 Insertion Sort List 】 python 实现
题目:Sort a linked list using insertion sort.代码:oj测试通过Runtime:860 ms 1 # Definition for singly-linked list. 2 # class ListNode: 3 # def __init__(sel...
分类:编程语言   时间:2015-01-03 21:03:14    阅读次数:208
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...
分类:编程语言   时间:2014-12-27 01:26:47    阅读次数:232
337条   上一页 1 ... 28 29 30 31 32 ... 34 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!