上一页 1 2 3 4 5 6 7 8 9 ··· 73 下一页
摘要: 题目 很简单的字符串处理题 class Solution { public: map<string, char> m; map<char, string> m2; bool wordPattern(string pattern, string str) { string s = ""; int i, 阅读全文
posted @ 2020-05-26 19:53 Shendu.CC 阅读(102) 评论(0) 推荐(0) 编辑
摘要: ``` #include #include #include #include #include #include #include #include #include #include using namespace std; struct Node { int val; Node* left; Node* right; Node(int value) { this->val = value; 阅读全文
posted @ 2020-05-19 08:44 Shendu.CC 阅读(131) 评论(0) 推荐(0) 编辑
摘要: ``` #include #include #include #include #include #include #include #include #include #include using namespace std; struct ListNode { int value; ListNode* next; ListNode(int value) { this->value = valu 阅读全文
posted @ 2020-05-19 08:43 Shendu.CC 阅读(126) 评论(0) 推荐(0) 编辑
摘要: "题目" 一道好题目。 发现数组里重复的数字是什么,不借助额外的数据结构。数组里的数字范围是1 n,数组的个数是n+1,所以一定存在重复的情况。重复的个数至少是1。如果题目说只有一个数字是重复的,那么就是另一道题目了。 首先根据这个数组的特性,按照数组的下标把从第0个数开始,把数组变成一个链表,链表 阅读全文
posted @ 2020-05-18 16:26 Shendu.CC 阅读(99) 评论(0) 推荐(0) 编辑
摘要: "题目" 再维护一个iterator ,用来实现peek 阅读全文
posted @ 2020-05-18 15:44 Shendu.CC 阅读(98) 评论(0) 推荐(0) 编辑
摘要: "题目" 题意:把一个数组里的所有0放到数组末尾,数组里其他数字的顺序不要变 题解: 可以利用冒泡的思想,写一个O(n^2)的方法。 更高效的是,从左往右计算每个非0数字在最后结果中的位置,就可以了。O(n) 阅读全文
posted @ 2020-05-13 17:25 Shendu.CC 阅读(100) 评论(0) 推荐(0) 编辑
摘要: "题目" 题解: 如标题,其实就是暴搜啦 阅读全文
posted @ 2020-05-13 17:21 Shendu.CC 阅读(143) 评论(0) 推荐(0) 编辑
摘要: "题目" 动态规划 阅读全文
posted @ 2020-05-09 17:09 Shendu.CC 阅读(110) 评论(0) 推荐(0) 编辑
摘要: "题目" 二分 阅读全文
posted @ 2020-05-09 16:53 Shendu.CC 阅读(103) 评论(0) 推荐(0) 编辑
摘要: "题目" 现在变了,数列是拍好序的,题目要求对数效率,因为x只可能有一个那就二分咯 阅读全文
posted @ 2020-05-09 16:27 Shendu.CC 阅读(108) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 73 下一页