上一页 1 2 3 4 5 6 7 8 9 ··· 29 下一页
摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes... 阅读全文
posted @ 2015-12-23 22:54 eversliver 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 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 @ 2015-12-22 22:09 eversliver 阅读(224) 评论(0) 推荐(0) 编辑
摘要: There areNgas stations along a circular route, where the amount of gas at stationiisgas[i].You have a car with an unlimited gas tank and it costscost[... 阅读全文
posted @ 2015-12-22 10:11 eversliver 阅读(650) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a multiple ofkthen left-o... 阅读全文
posted @ 2015-12-17 22:53 eversliver 阅读(310) 评论(0) 推荐(1) 编辑
摘要: 单例模式十分的常见也很常用,Boost库中就有单例的泛型实现,Qt中,可以利用原子指针来实现一个单例模式: 1 class SingleTon{ 2 public: 3 static SingleTon &getInstance(void) 4 { 5 //双重检测加... 阅读全文
posted @ 2015-12-16 22:42 eversliver 阅读(9083) 评论(0) 推荐(1) 编辑
摘要: Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.类似于归并2个链表,暴力一点的方法就是,每取出一个list就与以前的list归并返回merge后list,知... 阅读全文
posted @ 2015-12-15 22:09 eversliver 阅读(369) 评论(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-12-12 11:57 eversliver 阅读(316) 评论(0) 推荐(0) 编辑
摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.求出0,1矩阵中的最大矩形区域:DP问题,可以使用数组记下当前行位... 阅读全文
posted @ 2015-12-08 22:25 eversliver 阅读(594) 评论(0) 推荐(0) 编辑
摘要: Given a 2d grid map of'1's (land) and'0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent ... 阅读全文
posted @ 2015-12-08 20:21 eversliver 阅读(617) 评论(0) 推荐(0) 编辑
摘要: Determine if a Sudoku is valid, according to:Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with ... 阅读全文
posted @ 2015-12-02 20:59 eversliver 阅读(392) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 29 下一页