Algorithm
SnailTyan
纸上得来终觉浅,绝知此事要躬行。
展开
-
Leetcode145——Binary Tree Postorder Traversal
Leetcode145——Binary Tree Postorder Traversal原创 2017-03-21 18:28:32 · 787 阅读 · 0 评论 -
Leetcode94——Binary Tree Inorder Traversal
Leetcode94——Binary Tree Inorder Traversal原创 2017-03-21 18:29:59 · 1037 阅读 · 0 评论 -
Leetcode144——Binary Tree Preorder Traversal
Leetcode144——Binary Tree Preorder Traversal原创 2017-03-21 18:30:44 · 1005 阅读 · 0 评论 -
Leetcode102——Binary Tree Level Order Traversal
Leetcode102——Binary Tree Level Order Traversal原创 2017-03-22 11:52:20 · 939 阅读 · 0 评论 -
Leetcode198——House Robber
Leetcode198——House Robber原创 2017-04-08 18:34:38 · 855 阅读 · 0 评论 -
Leetcode46——Permutations
Leetcode46——Permutations原创 2017-04-08 21:05:57 · 778 阅读 · 1 评论 -
Leetcode78——Subsets
Leetcode78——Subsets原创 2017-04-08 22:57:56 · 747 阅读 · 0 评论 -
Leetcode108——Convert Sorted Array to Binary Search Tree
Leetcode108——Convert Sorted Array to Binary Search Tree原创 2017-03-23 18:00:17 · 916 阅读 · 0 评论 -
Leetcode402——Remove K Digits
Leetcode402——Remove K Digits原创 2017-04-09 18:17:13 · 883 阅读 · 0 评论 -
Leetcode394——Decode String
Leetcode394——Decode String原创 2017-03-14 17:19:28 · 1152 阅读 · 0 评论 -
Leetcode128——Longest Consecutive Sequence
Leetcode128——Longest Consecutive Sequence原创 2017-03-14 18:31:08 · 759 阅读 · 0 评论 -
Leetcode53——Maximum Subarray
Leetcode53——Maximum Subarray原创 2017-03-14 17:18:21 · 847 阅读 · 0 评论 -
Leetcode152——Maximum Product Subarray
Leetcode152——Maximum Product Subarray原创 2017-03-14 19:08:06 · 757 阅读 · 0 评论 -
Leetcode155——Min Stack
Leetcode155——Min Stack原创 2017-03-14 22:51:31 · 633 阅读 · 0 评论 -
Leetcode109——Convert Sorted List to Binary Search Tree
Leetcode109——Convert Sorted List to Binary Search Tree原创 2017-03-24 13:54:40 · 1020 阅读 · 0 评论 -
Leetcode3——Longest Substring Without Repeating Characters
Leetcode3——Longest Substring Without Repeating Characters原创 2017-04-01 16:48:09 · 740 阅读 · 0 评论 -
Leetcode2——Add Two Numbers
Leetcode2——Add Two Numbers原创 2017-03-16 17:56:28 · 1091 阅读 · 0 评论 -
Leetcode 1——Two Sum
Leetcode1——Two Sum原创 2017-03-15 11:58:00 · 732 阅读 · 0 评论 -
枚举——生理周期
枚举——生理周期原创 2017-12-19 21:59:30 · 898 阅读 · 0 评论 -
枚举——称硬币
枚举——称硬币原创 2017-12-20 21:40:10 · 1378 阅读 · 1 评论 -
枚举——熄灯问题
枚举——熄灯问题原创 2017-12-23 14:52:49 · 1394 阅读 · 0 评论 -
递归——求阶乘
递归——求阶乘原创 2017-12-26 22:11:47 · 1483 阅读 · 0 评论 -
枚举——完美立方
枚举——完美立方原创 2017-12-18 21:12:21 · 2859 阅读 · 0 评论 -
递归——汉诺塔
递归——汉诺塔原创 2017-12-28 17:24:42 · 1258 阅读 · 0 评论 -
Leetcode 18. 4Sum
文章作者:Tyan 博客:noahsnail.com  |  CSDN  |  简书1. Description2. SolutionsBrute Forceclass Solution {public: vector<vector<int>> fourSum(vecto原创 2018-07-09 18:01:51 · 172 阅读 · 0 评论 -
Leetcode 507. Perfect Number
文章作者:Tyan 博客:noahsnail.com  |  CSDN  |  简书1. Description2. Solutionclass Solution {public: bool checkPerfectNumber(int num) { if(num == 1) { ...原创 2018-07-16 18:22:40 · 246 阅读 · 0 评论 -
Leetcode 101. Symmetric Tree
文章作者:Tyan 博客:noahsnail.com  |  CSDN  |  简书1. Description2. SolutionRecursive/** * Definition for a binary tree node. * struct TreeNode { * int val; * ...原创 2018-07-16 18:23:21 · 210 阅读 · 0 评论 -
Leetcode 55. Jump Game
文章作者:Tyan 博客:noahsnail.com  |  CSDN  |  简书1. Description递归遍历所有的可能class Solution {public: bool canJump(vector<int>& nums) {原创 2018-07-10 18:20:59 · 182 阅读 · 0 评论 -
Leetcode 54. Spiral Matrix
文章作者:Tyan 博客:noahsnail.com  |  CSDN  |  简书1. Description2. Solutionclass Solution {public: vector<int> spiralOrder(vector<vector<int&原创 2018-07-11 18:00:29 · 259 阅读 · 0 评论 -
Leetcode 35. Search Insert Position
文章作者:Tyan 博客:noahsnail.com  |  CSDN  |  简书1. 问题描述Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be...原创 2018-07-05 11:41:43 · 237 阅读 · 0 评论 -
Leetcode 11. Container With Most Water
文章作者:Tyan 博客:noahsnail.com  |  CSDN  |  简书1. Description2. SolutionBrute Forceclass Solution {public: int maxArea(vector<int>& height) { i原创 2018-07-05 11:42:19 · 203 阅读 · 0 评论 -
Leetcode 387. First Unique Character in a String
文章作者:Tyan 博客:noahsnail.com | CSDN | 简书1. Description2. SolutionTwo loopsclass Solution {public: int firstUniqChar(string s) { int index[256] = {...原创 2018-07-23 18:23:17 · 186 阅读 · 0 评论 -
Leetcode 96. Unique Binary Search Trees
文章作者:Tyan 博客:noahsnail.com  |  CSDN  |  简书1. Description2. Solution参考 DP Solution in 6 lines with explanation. F(i, n) = G(i-1) * G(n-i)class Solution {public:...原创 2018-07-17 22:29:35 · 262 阅读 · 0 评论 -
Leetcode 59. Spiral Matrix II
文章作者:Tyan 博客:noahsnail.com  |  CSDN  |  简书1. Description2. Solutionclass Solution {public: vector<vector<int>> generateMatrix(int n) {原创 2018-07-12 11:41:18 · 169 阅读 · 0 评论 -
Leetcode 45. Jump Game II
文章作者:Tyan 博客:noahsnail.com  |  CSDN  |  简书1. Description2. Solutionclass Solution {public: int jump(vector<int>& nums) {原创 2018-07-12 18:19:56 · 175 阅读 · 0 评论 -
Leetcode 74. Search a 2D Matrix
文章作者:Tyan 博客:noahsnail.com  |  CSDN  |  简书1. Description2. SolutionTreated as a matrixclass Solution {public: bool searchMatrix(vector<vector<int>&原创 2018-07-18 18:26:20 · 258 阅读 · 0 评论 -
Leetcode 240. Search a 2D Matrix II
文章作者:Tyan 博客:noahsnail.com  |  CSDN  |  简书1. Description2. SolutionO(mlogn) class Solution {public: bool searchMatrix(vector<vector<int>&gt原创 2018-07-18 18:27:03 · 228 阅读 · 0 评论 -
Leetcode 16. 3Sum Closest
文章作者:Tyan 博客:noahsnail.com  |  CSDN  |  简书1. Description2. SolutionBrute Forceclass Solution {public: int threeSumClosest(vector<int>& nums, int t原创 2018-07-06 14:29:56 · 211 阅读 · 0 评论 -
Leetcode 84. Largest Rectangle in Histogram
文章作者:Tyan 博客:noahsnail.com | CSDN | 简书1. Description2. SolutionO(N^2)class Solution {public: int largestRectangleArea(vector<int>& heights) {...原创 2018-07-24 18:49:53 · 204 阅读 · 0 评论 -
Leetcode 136. Single Number
文章作者:Tyan 博客:noahsnail.com | CSDN | 简书1. Description2. SolutionSimple Methodclass Solution {public: int singleNumber(vector<int>& nums) { ...原创 2018-07-24 18:50:25 · 203 阅读 · 0 评论