摘要: /** * Definition for singly-linked list with a random pointer. * struct RandomListNode { * int label; * RandomListNode *next, *random; * RandomListNode(int x) : label(x), next(NULL), random(NULL) {} * }; */class Solution {public: RandomListNode *copyRandomList(RandomListNode *head) { ... 阅读全文
posted @ 2014-03-14 21:10 卖程序的小歪 阅读(328) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: int uniquePathsWithObstacles(vector > &obstacleGrid) { vector >& dp = obstacleGrid; if (dp.empty() || dp[0].e... 阅读全文
posted @ 2014-03-14 19:56 卖程序的小歪 阅读(157) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: int uniquePaths(int m, int n) { int (*dp)[101] = new int[101][101]; for (int i=0;i<101;i++) dp[0][i] = 0; ... 阅读全文
posted @ 2014-03-14 16:58 卖程序的小歪 阅读(154) 评论(0) 推荐(0) 编辑