yhyh_2
yhyh_2
全部文章
分类
题解(2)
归档
标签
去牛客网
登录
/
注册
yhyh_2的博客
全部文章
(共9篇)
题解 | #马踏棋盘#
#include<bits/stdc++.h> using namespace std; int dx[4] = {1,1,2,2}, dy[4] = {2, -2, 1, -1}; int n,m,ans; bool vis[20][20]; void dfs(int x, int...
C++
深度优先搜索
2024-09-20
1
89
题解 | #N皇后问题#
#include<iostream> #include<cstring> #include<algorithm> #include<cmath> using namespace std; const int N = 20; struct node...
C++
深度优先搜索
2024-09-20
0
63
题解 | #在二叉树中找到两个节点的最近公共祖先#
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2024-09-16
0
96
题解 | #二叉搜索树的最近公共祖先#
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2024-09-16
0
74
题解 | #判断是不是平衡二叉树#
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2024-09-16
0
71
题解 | #判断是不是完全二叉树#
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2024-09-16
0
106
题解 | #判断是不是二叉搜索树#
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2024-09-15
0
60
题解 | #二叉树的镜像#
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2024-09-15
0
76
题解 | #二叉搜索树与双向链表#
/* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) { } };*/ class ...
2024-09-15
0
91