链表:https://www.cnblogs.com/zhangwanying/p/9797184.html (共34题) 数组:https://www.cnblogs.com/zhangwanying/p/9610923.html (共139题) 树:https://www.cnblogs.com/zhangwanying/p/6753328.html (共94题) 哈希表:https://www.cnblogs.com/zhangwanying/p/9886262.html (共88题) D…
按照Leetcode的Tag来刷题,从easy到hard刷题 关于如何让Leetcode按难易程度排序,可按以下步骤: 1. 进入Leetcode后,点击code 2.点击code后,可查看所有题目,可看到右下角有Tag标志,选择想要刷的Tag即可 3. 点击Tag后,可看到该Tag下所有的题目,点击Acceptance, 可看到题目按从接收程度排序,然后点击两次Difficulty,则每次都会显示相同的排序方式 这样就可以尽情的从易到难刷题了,附上我的Leetcode刷题记录,求轻喷 Leet…
开源 iOS 项目分类索引大全 GitHub 上大概600个开源 iOS 项目的分类和介绍,对于你挑选和使用开源项目应该有帮助 系统基础库 Category/Util sstoolkit 一套Category类型的库,附带很多自定义控件 功能不错-     BlocksKit 将Block风格带入UIKit和Founcation     cocoa-helpers 一些Cocoa的扩展 2年前的工程     CoconutKit 一系列扩展和一些自定组件     STUtils 一系列扩展包  …
LeetCode:颜色分类[75] 题目描述 给定一个包含红色.白色和蓝色,一共 n 个元素的数组,原地对它们进行排序,使得相同颜色的元素相邻,并按照红色.白色.蓝色顺序排列. 此题中,我们使用整数 0. 1 和 2 分别表示红色.白色和蓝色. 注意:不能使用代码库中的排序函数来解决这道题. 示例: 输入: [2,0,2,1,1,0] 输出: [0,0,1,1,2,2] 进阶: 一个直观的解决方案是使用计数排序的两趟扫描算法.首先,迭代计算出0.1 和 2 元素的个数,然后按照0.1.2的排序,…
链接:https://leetcode.com/tag/recursion/ 247 Strobogrammatic Number II (2019年2月22日,谷歌tag) 给了一个 n,给出长度为 n 的所有上下颠倒 180度以后都看起来一样的数字字符串. 题解:dfs,回溯.注意所有的能有pair的序列是 0, 1, 8, 6, 9 class Solution { public: vector<string> findStrobogrammatic(int n) { vector<…
LeetCode 题目总结/分类 利用堆栈: http://oj.leetcode.com/problems/evaluate-reverse-polish-notation/ http://oj.leetcode.com/problems/longest-valid-parentheses/ (也可以用一维数组,贪心) http://oj.leetcode.com/problems/valid-parentheses/ http://oj.leetcode.com/problems/large…
Leetcode春季打卡活动 第二题:206. 反转链表 206. 反转链表 Talk is cheap . Show me the code . /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* h…
Leetcode 春季打卡活动 第一题:225. 用队列实现栈 Leetcode 春季打卡活动 第一题:225. 用队列实现栈 解题思路 这里用了非常简单的思路,就是在push函数上做点操作,让队头总是最后一个元素即可. 也就是说,每新进一个新元素,就把前面的所有元素逐个弹出放到队尾即可. Talk is cheap . Show me the code . class MyStack { public: queue<int> que; int size,temp; /** Initializ…
[334]Increasing Triplet Subsequence (2019年2月14日,google tag)(greedy) 给了一个数组 nums,判断是否有三个数字组成子序列,使得子序列递增.题目要求time complexity: O(N),space complexity: O(1) Return true if there exists i, j, k such that arr[i] < arr[j] < arr[k] given 0 ≤ i < j < k …
1. Array 基础 27 Remove Element 26 Remove Duplicates from Sorted Array 80 Remove Duplicates from Sorted Array II 277 Find the Celebrity 189 Rotate Array 41 First Missing Positive 299 Bulls and Cows 134 Gas Station 118 Pascal's Triangle 很少考 119 Pascal's…