宁静的冬日
宁静的冬日
全部文章
题解
python学习(4)
代码笔记(4)
归档
标签
去牛客网
登录
/
注册
宁静的冬日的博客
全部文章
/ 题解
(共81篇)
题解 | #第一个只出现一次的字符#
class Solution { public: int FirstNotRepeatingChar(string str) { unordered_map<char,int>m_firstpos; unordered_map<char,in...
C++
2022-04-06
0
323
题解 | #把数组排成最小的数#
class Solution { public: //将数字转成字符串 string itos(int n) { if (n == 0)return"0"; string s; while (n) { s += '0' + n % 10; n /= 10; } ...
C++
2022-04-05
0
328
题解 | #字符串的排列#
dfs,永远滴神 class Solution { public: set<string>v; string nows; void dfs(string str){ if(str.empty()){ v.inser...
C++
2022-04-04
0
307
题解 | #复杂链表的复制#
class Solution { public: RandomListNode* Clone(RandomListNode* pHead) { //hash表,用于记录旧节点对应的新节点是否已经开辟,同时建立两者的联系 unordered_map< RandomListNode*, ...
C++
2022-04-04
0
393
题解 | #二叉树中和为某一值的路径(二)#
class Solution { public: vector<int>path; vector<vector<int>>result; int nowlen,target; void dfs(TreeNode* root){ ...
C++
2022-04-04
0
320
题解 | #二叉搜索树的后序遍历序列#
class Solution { public: vector<int>v; bool helper(int head,int tail){ if(head>tail)return true; if(head==tail)return...
C++
2022-04-04
0
312
题解 | #从上往下打印二叉树#
class Solution { public: vector<int> PrintFromTopToBottom(TreeNode* root) { if(root==NULL)return {}; queue<TreeNode*...
C++
2022-04-04
0
316
题解 | #包含min函数的栈#
class Solution { public: int minnum; stack<int>s; vector<int>minv;//存储当前的最小值 Solution(){ minv.push_back(10001); ...
C++
2022-04-04
0
270
题解 | #二叉树的深度#
class Solution { public: int TreeDepth(TreeNode* pRoot) { if(pRoot==NULL)return 0; return 1+max(TreeDepth(pRoot->left),TreeDept...
C++
2022-04-04
0
289
题解 | #栈的压入、弹出序列#
class Solution { public: bool IsPopOrder(vector<int> pushV,vector<int> popV) { stack<int> s; int index=0; ...
C++
栈
2022-04-04
0
359
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页