Dfine
Dfine
全部文章
分类
归档
标签
去牛客网
登录
/
注册
Dfine的博客
全部文章
(共78篇)
题解 | 找出缺失的整数
class Finder { public: int findMissing(vector<vector<int> > numbers, int n) { // write code here int flag = 1; ...
2025-07-03
0
24
题解 | 奇偶位交换
class Exchange { public: int exchangeOddEven(int x) { // write code here return ((x & 0xAAAAAAAA) >>1 ) | ((x & 0x555...
2025-07-03
0
24
题解 | 整数转化
class Transform { public: int calcCost(int A, int B) { // write code here int count = 0; for (int i = 0; i < 32; i++)...
2025-07-03
0
27
题解 | 最接近的数
#include <vector> class CloseNumber { public: vector<int> getCloseNumber(int x) { // write code here int c0=0, c1=0; ...
2025-07-03
0
21
题解 | 二进制插入
#include <cmath> class BinInsert { public: int binInsert(int n, int m, int j, int i) { // write code here n = n | (m<<...
2025-07-01
0
26
题解 | 最近公共祖先
class LCA { public: int getLCA(int a, int b) { // write code here if(a>b) return getLCA(b, a); if(a==b) return a; ...
2025-07-01
0
28
题解 | 寻找下一个结点
/* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(N...
2025-07-01
0
22
题解 | 检查是否为BST
/* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(N...
2025-07-01
0
22
题解 | 输出单层结点
/* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(N...
2025-07-01
0
28
题解 | 高度最小的BST
#include <algorithm> #include <vector> class MinimalBST { int build(const vector<int> &vals, int left, int right){ i...
2025-07-01
0
21
首页
上一页
1
2
3
4
5
6
7
8
下一页
末页