上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 29 下一页
摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array[2,3,-2,4],the... 阅读全文
posted @ 2015-10-17 12:13 eversliver 阅读(270) 评论(0) 推荐(0) 编辑
摘要: Given two stringssandt, write a function to determine iftis an anagram ofs.For example,s= "anagram",t= "nagaram", return true.s= "rat",t= "car", retur... 阅读全文
posted @ 2015-10-17 11:19 eversliver 阅读(326) 评论(0) 推荐(0) 编辑
摘要: Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"简化路径,linux下面简单的路径操作而已,代码... 阅读全文
posted @ 2015-10-16 22:12 eversliver 阅读(325) 评论(0) 推荐(0) 编辑
摘要: Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express... 阅读全文
posted @ 2015-10-16 20:50 eversliver 阅读(325) 评论(0) 推荐(0) 编辑
摘要: 教研室的项目,就是用Qt做个图形界面能收发数据就可以了,但是创建数据管理类的时候需要各种new, delete,很小心了但是内存使用量在不断开关程序之后函数会长,由于用的是gcc 4.7.* 所以好像没有shared_ptr可以用,上网查了一下原来QT也有智能指针。常用的有 QScopedPoint... 阅读全文
posted @ 2015-10-15 17:07 eversliver 阅读(1893) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (ie... 阅读全文
posted @ 2015-10-14 21:46 eversliver 阅读(421) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a... 阅读全文
posted @ 2015-10-14 21:13 eversliver 阅读(176) 评论(0) 推荐(0) 编辑
摘要: Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu... 阅读全文
posted @ 2015-10-14 20:47 eversliver 阅读(210) 评论(0) 推荐(0) 编辑
摘要: Implement pow(x, n). 幂运算,简单的方法snag然很好实现,直接循环相乘就可以了,但是这里应该不是那种那么简单,我的做法使用到了一点递归: 这里有个注意点就是考虑到INT_MIN的情况,做出相应的处理 下面是java写的版本: 阅读全文
posted @ 2015-10-14 09:38 eversliver 阅读(293) 评论(0) 推荐(0) 编辑
摘要: Sort a linked list using insertion sort.用插入排序来排序一个list,额, 我写的好麻烦啊, debug了好久,至少提交了5次。。。写吐了快,先贴代码,写的也好乱啊: 1 class Solution { 2 public: 3 ListNode* i... 阅读全文
posted @ 2015-10-13 21:49 eversliver 阅读(281) 评论(0) 推荐(0) 编辑
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 29 下一页