码迷,mamicode.com
首页 >  
搜索关键字:map list    ( 77989个结果
Leetcode: Remove Duplicates from Sorted List
遇到的问题:input{1,1,1}, output{1,1}, expected{1}, 原因在于若temp.val==temp.next.val, 则需要temp.next=temp.next.next, 这时候就不要temp=temp.next了注意停止条件不光是temp!=null,还应该有...
分类:其他好文   时间:2014-05-05 22:47:08    阅读次数:454
Reverse Nodes in k-Group
Link:http://oj.leetcode.com/problems/reverse-nodes-in-k-group/Given a linked list, reverse the nodes of a linked listkat a time and return its modifie...
分类:其他好文   时间:2014-05-05 22:46:42    阅读次数:456
Reverse Linked List II
Link:http://oj.leetcode.com/problems/reverse-linked-list-ii/Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1...
分类:其他好文   时间:2014-05-05 22:46:11    阅读次数:411
Swap Nodes in Pairs
Link:http://oj.leetcode.com/problems/swap-nodes-in-pairs/Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2-...
分类:其他好文   时间:2014-05-05 22:45:37    阅读次数:331
【HDOJ】2544 最短路
Dijkstra。 1 #include 2 #include 3 4 #define INF 0xfffffff 5 6 int map[105][105]; 7 int dp[105]; 8 char visit[105]; 9 10 int main() {11 int n, ...
分类:其他好文   时间:2014-05-05 22:34:42    阅读次数:406
python 列表推导式----轻量级循环
列表推导式(list comprehension)是利用其他列表创建新列表(类似于数学术语中的集合推导式)的一种方法。它的工作方式类似于for循环,也很简单:In [39]: [x*x for x in range(10)]Out[39]: [0, 1, 4, 9, 16, 25, 36, 49, ...
分类:编程语言   时间:2014-05-05 22:21:48    阅读次数:422
codechef Turbo Sort 题解
Input t – the number of numbers in list, then t lines follow [t  Each line contains one integer: N [0 N  Output Output given numbers in non decreasing order. Example Input: 5 5 3 ...
分类:其他好文   时间:2014-05-04 00:04:09    阅读次数:376
Havel--Hakimi定理判断可图化 python
list1 = [ 4, 7, 7, 3, 3, 3, 2, 1 ] list2 = [ 5, 4, 3, 3, 2, 2, 2, 1, 1, 1 ] def havel_hakimi_algo( degree_list ): degree_list.sort( reverse = True ) print degree_list for degr...
分类:编程语言   时间:2014-05-03 17:13:49    阅读次数:426
RDD的依赖关系
RDD的依赖关系 Rdd之间的依赖关系通过rdd中的getDependencies来进行表示, 在提交job后,会通过在DAGShuduler.submitStage-->getMissingParentStages privatedefgetMissingParentStages(stage: Stage): List[Stage] = { valmissing =newHash...
分类:其他好文   时间:2014-05-03 15:56:22    阅读次数:282
hdu_1228 A + B
http://acm.hdu.edu.cn/showproblem.php?pid=1228 分析:         我只是想练习一下map的用法,不然又忘了。。。 代码: //hdu 1228 #include #include #include #include #include using namespace std; map d; void init()...
分类:其他好文   时间:2014-05-03 15:40:58    阅读次数:232
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!