上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 26 下一页
摘要: Sort a linked list inO(nlogn) time using constant space complexity./** * Definition for singly-linked list. * public class ListNode { * int val; *... 阅读全文
posted @ 2015-08-01 17:58 ~每天进步一点点~ 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Sort a linked list using insertion sort./** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * L... 阅读全文
posted @ 2015-08-01 17:16 ~每天进步一点点~ 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get the valu... 阅读全文
posted @ 2015-07-28 00:19 ~每天进步一点点~ 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1]./*... 阅读全文
posted @ 2015-07-27 13:08 ~每天进步一点点~ 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3]./**... 阅读全文
posted @ 2015-07-26 23:13 ~每天进步一点点~ 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 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 exam... 阅读全文
posted @ 2015-07-26 22:57 ~每天进步一点点~ 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 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?因为f... 阅读全文
posted @ 2015-07-26 22:21 ~每天进步一点点~ 阅读(87) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?/** * Definition for singly-linked list. *... 阅读全文
posted @ 2015-07-26 21:55 ~每天进步一点点~ 阅读(105) 评论(0) 推荐(0) 编辑
摘要: Given a stringsand a dictionary of wordsdict, add spaces insto construct a sentence where each word is a valid dictionary word.Return all such possibl... 阅读全文
posted @ 2015-07-26 20:46 ~每天进步一点点~ 阅读(204) 评论(0) 推荐(0) 编辑
摘要: Given a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequence of one or more dictionary words.For exampl... 阅读全文
posted @ 2015-07-26 20:09 ~每天进步一点点~ 阅读(128) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 26 下一页