![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
牛客网
whiteParachute
这个作者很懒,什么都没留下…
展开
-
牛客网-剑指offer-二维数组中的查找
运行时间:13ms占用内存:1496kclass Solution { public: bool Find(int target, vector<vector<int> > array) { int rows = 0; int cols = array[0].size() - 1; while(rows < ar...原创 2018-05-03 11:00:04 · 131 阅读 · 0 评论 -
牛客网-剑指offer-替换空格
运行时间:6ms占用内存:608kclass Solution { public: void replaceSpace(char *str,int length) { for(int i = 0; i < length - 1; i++) { if(str[i] == ' ') { ...原创 2018-05-03 11:08:43 · 150 阅读 · 0 评论 -
牛客网-剑指offer-重建二叉树
运行时间:7ms占用内存:476k/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * };...原创 2018-05-03 16:20:39 · 168 阅读 · 0 评论 -
牛客网-剑指offer-从尾到头打印链表
运行时间:3ms占用内存:608k/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : * val(x), next(NULL) { * } * }; */ class Solution { public: ...原创 2018-05-03 11:20:37 · 132 阅读 · 0 评论