随笔分类 -  leetcode

leetcode 题型总结
数据结构可视化软件
摘要:本次记录一下数据可视化软件,可以通过这个可视化软件清楚地看到一些数据结构的操作过程,比如红黑树的插入,旋转,调整等操作。 url: https://www.cs.usfca.edu/~galles/visualization/Algorithms.html 阅读全文

posted @ 2019-07-19 00:32 爱笑的张飞 阅读(1028) 评论(0) 推荐(0) 编辑

leetcode 动态规划类型题
摘要:1,Triangle 1 int mininumTotal(vector<vector<int>>& triangle) { 2 for (int i = triangle.size() - 2; i >= 0; --i) { 3 for (int j = 0; j < i + 1; ++j) { 阅读全文

posted @ 2019-04-21 19:28 爱笑的张飞 阅读(378) 评论(0) 推荐(0) 编辑

leetcode 树类型题
摘要:树的测试框架: 1 // leetcodeTree.cpp : 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include <iostream> 6 #include <queue> 7 #include <stack> 8 #include <ve 阅读全文

posted @ 2019-03-06 21:29 爱笑的张飞 阅读(240) 评论(0) 推荐(0) 编辑

leetcode 栈和队列类型题
摘要:1,Valid Parentheses 1 bool isVaild1(string& s) { // 直接列举,不易扩展 2 stack<char> stk; 3 for (int i = 0; i < s.length(); ++i) { 4 if (stk.empty()) 5 stk.pus 阅读全文

posted @ 2019-03-02 17:36 爱笑的张飞 阅读(280) 评论(0) 推荐(0) 编辑

leetcode 字符串类型题
摘要:1,Vaild Palindrome 1 bool isPalindrome(string& s) { 2 transform(s.begin(), s.end(), s.begin(), tolower); // 把字符全部转换成小写 3 int left = 0; 4 int right = s 阅读全文

posted @ 2019-03-01 16:55 爱笑的张飞 阅读(386) 评论(0) 推荐(0) 编辑

leetcode 链表类型题总结
摘要:链表测试框架示例: 1 // leetcodeList.cpp : 定义控制台应用程序的入口点。vs2013 测试通过 2 // 3 4 #include "stdafx.h" 5 #include <Windows.h> 6 #include <iostream> 7 8 using namesp 阅读全文

posted @ 2019-02-21 16:50 爱笑的张飞 阅读(296) 评论(0) 推荐(0) 编辑

leetcode 数组类型题总结
摘要:1,removeDuplicates(I) 1 int removeDuplicatesI(vector<int>& nums){ // 重新组织数组,同 removeDuplicates2IV 2 int index = 0; 3 for(int i=0;i<nums.size();++i){ 4 阅读全文

posted @ 2019-02-18 20:27 爱笑的张飞 阅读(658) 评论(0) 推荐(0) 编辑

leetcode 数组类型题
摘要:题目参考教材:https://github.com/soulmachine/leetcode(leetcode-cpp.pdf) 阅读全文

posted @ 2019-02-18 14:34 爱笑的张飞 阅读(262) 评论(0) 推荐(0) 编辑

leetcode 中等题(2)
摘要:50. Pow(x, n) (中等) 96. Unique Binary Search Trees(很快) 1 class Solution { 2 public: 3 int numTrees(int n) { 4 long ans=1; 5 for(int i=n+1;i<=2*n;i++) 6 阅读全文

posted @ 2019-01-01 19:18 爱笑的张飞 阅读(115) 评论(0) 推荐(0) 编辑

leetcode 中等题(1)
摘要:2. Add Two Numbers(中等) /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL 阅读全文

posted @ 2018-12-29 21:48 爱笑的张飞 阅读(356) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示