上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 80 下一页
摘要: Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer... 阅读全文
posted @ 2015-05-06 10:02 匡子语 阅读(310) 评论(0) 推荐(0)
摘要: Remove all elements from a linked list of integers that have valueval.ExampleGiven:1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6,val= 6Return:1 --> 2 --> 3 --... 阅读全文
posted @ 2015-05-06 09:55 匡子语 阅读(186) 评论(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-05-06 09:52 匡子语 阅读(227) 评论(0) 推荐(0)
摘要: 应小伙伴的要求,做一个小计时器。功能是点击开始就从00:00:00开始计时,点击暂停就暂停计时,点击停止就停止计时。界面如上图,使用ui设计师直接拖的。按钮和图标的图片都是网上下载的。用美图秀秀抠成了透明的,看起来会好看一点。整体代码挺容易的,就是设一个定时器。代码如下:mainwindow.h#i... 阅读全文
posted @ 2015-05-05 18:55 匡子语 阅读(8922) 评论(0) 推荐(1)
摘要: 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-05-04 14:09 匡子语 阅读(179) 评论(0) 推荐(0)
摘要: Compare two version numbersversion1andversion2.Ifversion1>version2return 1, ifversion1 n2) return 1; if(n1 n2) return 1; else if(n1... 阅读全文
posted @ 2015-05-04 14:05 匡子语 阅读(220) 评论(0) 推荐(0)
摘要: Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 ->... 阅读全文
posted @ 2015-05-04 12:58 匡子语 阅读(247) 评论(0) 推荐(0)
摘要: Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will return the next... 阅读全文
posted @ 2015-05-04 12:19 匡子语 阅读(161) 评论(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-05-03 22:10 匡子语 阅读(195) 评论(0) 推荐(0)
摘要: Given a 2D board containing'X'and'O', capture all regions surrounded by'X'.A region is captured by flipping all'O's into'X's in that surrounded region... 阅读全文
posted @ 2015-05-03 21:37 匡子语 阅读(244) 评论(0) 推荐(0)
上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 80 下一页