码迷,mamicode.com
首页 >  
搜索关键字:oj    ( 4253个结果
[LeetCode]147.Insertion Sort List
【题目】 Sort a linked list using insertion sort. 【分析】 无 【代码】 /********************************* * 日期:2015-01-09 * 作者:SJF0115 * 题目: 147.Insertion Sort List * 来源:https://oj.leetcode.com/prob...
分类:其他好文   时间:2015-01-09 12:37:26    阅读次数:107
OJ刷题之《寄居蟹与海葵》
题目描述 寄居蟹与海葵是一对合作互助的共栖伙伴。海葵是寄居蟹最称职的门卫。它用有毒的触角去蜇那些敢来靠近它们的所有动物,保护寄居蟹。而寄居蟹则背着行动困难的海葵,四出觅食,有福同享。  但并不是所有寄居蟹和海葵都可以做搭档的。那就要看海葵的身体是不是符合寄居蟹的螺壳。  海葵的身体是有褶皱的,而寄居蟹的螺壳同样凹凸不平,我们可以用一个大写字母组成的字符串来表示它们的高低程度,其中A代表0...
分类:其他好文   时间:2015-01-09 09:15:05    阅读次数:235
[LeetCode]134 Gas Station
https://oj.leetcode.com/problems/gas-station/http://blog.csdn.net/linhuanmars/article/details/22706553publicclassSolution{ publicintcanCompleteCircuit(int[]gas,int[]cost){ intlen=gas.length; //Costifrunallstations intallcost=0; //Startpoint intstart=0; ..
分类:其他好文   时间:2015-01-09 01:54:44    阅读次数:161
[LeetCode]133 Clone Graph
https://oj.leetcode.com/problems/clone-graph/http://blog.csdn.net/linhuanmars/article/details/22715747/** *Definitionforundirectedgraph. *classUndirectedGraphNode{ *intlabel; *List<UndirectedGraphNode>neighbors; *UndirectedGraphNode(intx){label=x;neig..
分类:其他好文   时间:2015-01-09 01:53:41    阅读次数:170
[LeetCode]140 Word Break II
https://oj.leetcode.com/problems/word-break-ii/http://blog.csdn.net/linhuanmars/article/details/22452163publicclassSolution{ publicList<String>wordBreak(Strings,Set<String>dict) { //SolutionA: //returnwordBreak_NP(s,dict); //SolutionB: return..
分类:其他好文   时间:2015-01-09 01:52:58    阅读次数:160
[LeetCode]141 Linked List Cycle
https://oj.leetcode.com/problems/linked-list-cycle/http://blog.csdn.net/linhuanmars/article/details/21200601/** *Definitionforsingly-linkedlist. *classListNode{ *intval; *ListNodenext; *ListNode(intx){ *val=x; *next=null; *} *} */ publicclassSolution{ publi..
分类:其他好文   时间:2015-01-09 01:52:33    阅读次数:155
[LeetCode]144 Binary Tree Preorder Traversal
https://oj.leetcode.com/problems/binary-tree-preorder-traversal/http://blog.csdn.net/linhuanmars/article/details/21428647/** *Definitionforbinarytree *publicclassTreeNode{ *intval; *TreeNodeleft; *TreeNoderight; *TreeNode(intx){val=x;} *} */ publicclassSolu..
分类:其他好文   时间:2015-01-09 01:52:30    阅读次数:274
[LeetCode]143 Reorder List
https://oj.leetcode.com/problems/reorder-list/http://blog.csdn.net/linhuanmars/article/details/21503215/** *Definitionforsingly-linkedlist. *classListNode{ *intval; *ListNodenext; *ListNode(intx){ *val=x; *next=null; *} *} */ publicclassSolution{ publicvoid..
分类:其他好文   时间:2015-01-09 01:51:44    阅读次数:175
[LeetCode]142 Linked List Cycle II
https://oj.leetcode.com/problems/linked-list-cycle-ii/http://blog.csdn.net/linhuanmars/article/details/21260943/** *Definitionforsingly-linkedlist. *classListNode{ *intval; *ListNodenext; *ListNode(intx){ *val=x; *next=null; *} *} */ publicclassSolution{ pu..
分类:其他好文   时间:2015-01-09 01:51:33    阅读次数:173
[LeetCode]146 LRU Cache
https://oj.leetcode.com/problems/lru-cache/http://blog.csdn.net/linhuanmars/article/details/21310633publicclassLRUCache{ publicLRUCache(intcapacity){ map=newHashMap<>(); head=null; tail=null; this.size=0; this.capacity=capacity; } publicintget(intke..
分类:系统相关   时间:2015-01-09 01:49:29    阅读次数:220
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!