会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
skyler's _log
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
下一页
2025年7月29日
树04
摘要: 112. 路径总和 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nul
阅读全文
posted @ 2025-07-29 10:14 skyler886
阅读(6)
评论(0)
推荐(0)
2025年7月28日
树03
摘要: 110. 平衡二叉树 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nu
阅读全文
posted @ 2025-07-28 11:46 skyler886
阅读(8)
评论(0)
推荐(0)
2025年7月27日
树02
摘要: 226. 翻转二叉树 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nu
阅读全文
posted @ 2025-07-27 11:32 skyler886
阅读(7)
评论(0)
推荐(0)
2025年7月25日
树01
摘要: 二叉树的递归遍历 前序 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(n
阅读全文
posted @ 2025-07-25 15:29 skyler886
阅读(9)
评论(0)
推荐(0)
2025年7月20日
图论01
摘要: 98. 所有可达路径 #include <iostream> #include <list> #include <vector> using namespace std; vector<vector<int>> result; vector<int> path; void dfs(vector<li
阅读全文
posted @ 2025-07-20 16:56 skyler886
阅读(12)
评论(0)
推荐(0)
2025年7月16日
字符串02
摘要: 151. 反转字符串中的单词 class Solution { public: void reverse(string& s, int start, int end){ //翻转,区间写法:左闭右闭 [] for (int i = start, j = end; i < j; i++, j--) {
阅读全文
posted @ 2025-07-16 16:53 skyler886
阅读(6)
评论(0)
推荐(0)
2025年7月15日
字符串01
摘要: 344. 反转字符串 class Solution { public: void reverseString(vector<char>& s) { int n = s.size(); cout << n; int count = 0; while(count < n / 2) { char tmp
阅读全文
posted @ 2025-07-15 20:42 skyler886
阅读(10)
评论(0)
推荐(0)
2025年7月14日
链表02
摘要: 24. 两两交换链表中的节点 class Solution { public: ListNode* swapPairs(ListNode* head) { ListNode * dummy_head = new ListNode(0); dummy_head->next = head; if(hea
阅读全文
posted @ 2025-07-14 21:13 skyler886
阅读(8)
评论(0)
推荐(0)
2025年7月9日
链表01
摘要: 203. 移除链表元素 虚拟头指针统一: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {}
阅读全文
posted @ 2025-07-09 10:56 skyler886
阅读(7)
评论(0)
推荐(0)
2025年7月8日
栈与队列02
摘要: 150. 逆波兰表达式求值 class Solution { public: int evalRPN(vector<string>& tokens) { stack<long long> st; for(int i = 0; i < tokens.size(); i++) { if(tokens[i
阅读全文
posted @ 2025-07-08 15:42 skyler886
阅读(12)
评论(0)
推荐(0)
上一页
1
2
3
4
5
下一页
公告