- 博客(7)
- 资源 (1)
- 收藏
- 关注
原创 [leetcode]Maximum Product Subarray最大子序列乘积
class Solution { public: int maxProduct(int A[], int n) { if(n==1) return A[0]; int ptable[n], ntable[n]; memset(ptable, 0, sizeof(ptable)); memset(ntable, 0, sizeo
2014-10-09 19:52:27 487
原创 一道亚马逊笔试题:给定钱买最少的商品
大意就是,有N个不同价值的商品,给你M块钱,怎样正好把钱花完然后买的商品数量最少? 解法一:iterative deepening search 先看一个商品可不可以花完,做一个深度优先搜索,再看两个商品,再看三个。。。。效率最低的方法 bool dfs(int n, int* A, int cur, int b, const vector& goods) { if(cur
2013-10-24 20:40:10 1732
原创 Two's complement
I have learned two's complement in the computer organization course. At that time, I simply knew that to express a negative number, first find it's positive form, then flip every bit of it and finally
2012-06-07 10:45:26 553
原创 Three Algorithms for Fibonacci
1. exponential algorithm: fib1(n) = fib1 (n-1) + fib1(n-2). running time: O(1.6n) 2. polynomial algorithm: which is also linear programming, running time O(n2) 3. using matrix multiplication: assu
2012-06-04 23:12:19 388
原创 微软面试经历
从微软两轮面试归来,只感到身心疲惫。尽力了,一切只是看天意了。 其实在收到面试邀请的时候,我以为这种面试就像是平时在校园里随处可见的小面试一样,随随便便聊几句,说说情况就过去了。没想到这种大公司,尤其是世界级别的公司的面试,果然是真枪实战,能进去的非等闲之辈。也对,如果一个公司随随便便就能进的话,那他也离倒闭不远了。所以说当我知道这个面试要进行两个小时三轮的时候,着实慌了。但是慌也没有用,解
2012-04-12 23:11:41 549
原创 Git学习笔记-Git Branching
1.Branch is just a pointer called HEAD which points to the current snapshot. 2.Create a new branch:git branch [branch-name]. 3.Switching to an existing branch:git checkout [new branch]. 4.Merge bra
2012-02-23 19:52:14 430
原创 Git学习笔记-Basic Git
1.Three main sections of Git: the git directory, the working directory, and the staging area. Git directory: where git stores the metadata and object database (most important). Working directory: a
2012-02-11 14:51:10 580
HTML5-step by step
2011-10-03
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人