Different Ways to Add ParenthesesGiven a string of numbers and operators, return all possible results from computing all the different possible ways t...
分类:
其他好文 时间:
2015-07-28 00:41:44
阅读次数:
117
Function.prototype.before = function(beforefn) { var _self = this; return function() { beforefn.apply(this, arguments); return _self.apply(this,...
分类:
Web程序 时间:
2015-07-28 00:31:27
阅读次数:
142
Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word doe...
分类:
其他好文 时间:
2015-07-28 00:28:09
阅读次数:
121
Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For exa...
分类:
其他好文 时间:
2015-07-28 00:25:01
阅读次数:
112
Different Ways to Add ParenthesesGiven a string of numbers and operators, return all possible results from computing all the different possible ways t...
分类:
其他好文 时间:
2015-07-28 00:24:47
阅读次数:
137
优先队列详解
写了一堆代码
#include
#include
#include
#include
#include
using namespace std;
//定义结构,使用运算符重载,自定义优先级1
struct cmp1{
bool operator ()(int &a,int &b){
return a>b;//最小值优先...
分类:
其他好文 时间:
2015-07-27 23:08:11
阅读次数:
194
Sqrt(x)
Implement int sqrt(int x).
Compute and return the square root of x.
解题思路:
这道题是求x的平方根。
解法1:基本的想法就是枚举,从1到n进行遍历,直到result*result>x,那么结果就是result-1。
class Solution {
public:
int...
分类:
其他好文 时间:
2015-07-27 23:08:04
阅读次数:
160
函数指针
#include
int jug(int x, int y)
{
if (x >= 0)
return x;
else if (y == 0)
return x;
else
return x / y;
}
int sub(int x, int y)
{
return (x + y);
}
int minus(int x, int y)
{
r...
分类:
其他好文 时间:
2015-07-27 23:01:10
阅读次数:
210
1 public class WaterImgHandler:IHttpHandler 2 { 3 4 public bool IsReusable 5 { 6 get { return false; } 7 } 8...
分类:
其他好文 时间:
2015-07-27 22:44:02
阅读次数:
131
Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321notice:Have you thought about this?Here are some good questions...
分类:
其他好文 时间:
2015-07-27 22:41:05
阅读次数:
98