
LeetCode
文章平均质量分 59
csdn_ggboy
这个作者很勤快,但是什么都没有留下
展开
-
leetcode——启发式搜索
127. 单词接龙 - 力扣(LeetCode)class Solution{public: typedef pair<int,int> PII; bool edgeif(string a, string b) { unordered_map<char, int> mp; if (a == b) return true; bool flag = false; for原创 2022-04-20 10:40:54 · 330 阅读 · 1 评论 -
模拟退火——leetcode
模拟退火、爬山法原创 2021-12-17 12:10:29 · 464 阅读 · 1 评论 -
图论——leetcode
图论练习原创 2021-12-15 11:52:33 · 515 阅读 · 0 评论 -
设计——leetcode
155. 最小栈 - 力扣(LeetCode)class MinStack {public: stack<int> st; stack<int> minst; MinStack() { minst.push(INT_MAX); } void push(int val) { st.push(val); minst.push(min(minst.top(), val)); }原创 2021-12-12 22:24:41 · 3402 阅读 · 0 评论 -
dfs和bfs——leetcode
797. 所有可能的路径 - 力扣(LeetCode)class Solution {public: vector<vector<int>> ans; vector<int> stk; void dfs(vector<vector<int>>& graph, int x, int n) { if (x == n) { ans.push_back(stk);原创 2021-12-08 20:42:20 · 176 阅读 · 0 评论 -
动态规划——leetcode
动态规划总结原创 2021-12-08 12:21:14 · 680 阅读 · 0 评论 -
滑动窗口——leetcode
30. 串联所有单词的子串 - 力扣(LeetCode)class Solution {public: unordered_map<string, int> mp; vector<int> findSubstring(string s, vector<string>& words) { //单词长度相同 int n = s.size(); int m = words[0].size();原创 2021-12-05 21:30:53 · 570 阅读 · 0 评论 -
双指针——leetcode
双指针解决有序数组的问题原创 2021-12-03 11:22:36 · 3646 阅读 · 0 评论 -
二叉树——leetcode
二叉搜索树的中序遍历是有序的原创 2021-11-30 20:51:05 · 331 阅读 · 0 评论 -
树的搜索——leetcode
树的搜索原创 2021-11-30 12:16:30 · 112 阅读 · 0 评论 -
LeetCode——计算表达式
224. 基本计算器 - 力扣(LeetCode)【进阶补充】双栈解决通用「表达式计算」问题class Solution {public: void replace(string &s) { int pos = s.find(" "); while(pos != -1) { s.replace(pos, 1, ""); pos = s.find(" "); }原创 2021-11-27 18:09:47 · 412 阅读 · 0 评论 -
力扣刷题指南
链表计算表达式原创 2021-11-27 17:31:09 · 364 阅读 · 0 评论 -
LeetCode链表
文章目录链表翻转链表删除元素删除元素II链表翻转链表回溯法函数的意义是返回翻转后的链表头。class Solution {public: ListNode* reverseList(ListNode* head) { if(head == nullptr || head->next == nullptr) return head; ListNode *newhead = reverseList(head->next);原创 2021-10-30 21:29:04 · 112 阅读 · 0 评论