腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
首页
学习
活动
专区
工具
TVP
最新优惠活动
返回腾讯云官网
算法修养
专栏作者
举报
674
文章
385128
阅读量
49
订阅数
订阅专栏
申请加入专栏
全部文章(674)
编程算法(343)
数据结构(231)
其他(97)
c++(27)
数组(17)
二叉树(16)
动态规划(14)
人工智能(13)
java(12)
ios(11)
dfs(11)
.net(9)
dp(8)
github(7)
字符串(7)
https(6)
binary(6)
遍历(6)
递归(6)
排序(6)
效率(6)
git(5)
lucene/solr(5)
容器镜像服务(5)
http(4)
容器(4)
add(4)
hash(4)
integer(4)
二进制(4)
php(3)
asp.net(3)
ajax(3)
analyzer(3)
nginx(3)
缓存(3)
digits(3)
height(3)
int(3)
ode(3)
搜索(3)
对象存储(2)
python(2)
javascript(2)
数据库(2)
搜索引擎(2)
开源(2)
分布式(2)
正则表达式(2)
class(2)
double(2)
excel(2)
for循环(2)
matrix(2)
numbers(2)
public(2)
size(2)
string(2)
sum(2)
tree(2)
博客(2)
数据(2)
算法(2)
指针(2)
lua(1)
regex(1)
node.js(1)
xml(1)
css(1)
json(1)
云数据库 SQL Server(1)
memcached(1)
sql(1)
flask(1)
ide(1)
api(1)
struts(1)
tomcat(1)
全文检索(1)
linux(1)
ubuntu(1)
apache(1)
压力测试(1)
网络安全(1)
ssh(1)
openstack(1)
asp(1)
单元测试(1)
数据处理(1)
windows(1)
nat(1)
postcss(1)
area(1)
bit(1)
break(1)
count(1)
data(1)
dictionary(1)
element(1)
expression(1)
factorial(1)
frequency(1)
grid(1)
hashtable(1)
input(1)
insert(1)
iterator(1)
limit(1)
list(1)
map(1)
next(1)
nlog(1)
nodes(1)
output(1)
pascal(1)
sudoku(1)
summary(1)
target(1)
void(1)
word(1)
变量(1)
编码(1)
继承(1)
基础(1)
集合(1)
接口(1)
链表(1)
统计(1)
序列化(1)
压缩(1)
原理(1)
重构(1)
搜索文章
搜索
搜索
关闭
LeetCode weekly contest 278 (amazon pay)
二叉树
hash
word
第三题 O(n)的计算hash值。利用取模运算法则,从后往前先计算k个字符的hash 值, 然后开始向左移动,每次移动都要先减去右边最后一个值,然后再乘以P,最后加上左边的
ShenduCC
2022-03-10
262
0
LeetCode 226. Invert Binary Tree
二叉树
题目 翻转二叉树 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: TreeNode* invertTree(T
ShenduCC
2022-03-10
188
0
LeetCode 1803. Count Pairs With XOR in a Range (二叉树)
二叉树
数组
题目 在一个数组里面找到两个数异或的结果在某个范围之内。 这种题目,就要用二叉树, 代码写的又臭又长。。 struct Node { int value; int left; int right; int num; int pos; }tree[200005]; class Solution { public: int hight; int lower; int fun(int root, int number, int h, int l, int pos) { if(pos==
ShenduCC
2021-06-22
302
0
LeetCode 222. Count Complete Tree Nodes(二分+位运算)
二叉树
题解:DFS 或者BFS都太low,我们可以用O(log(n)^2)的效率解决,n为节点个数,log(n)就是树的高度。
ShenduCC
2020-02-25
352
0
LeetCode 199. Binary Tree Right Side View
二叉树
题目 题意:假如你在一棵二叉树的右边,往左看,能看到哪些元素。 题解:广搜,每一层的最右边元素即可。 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ struct No
ShenduCC
2020-02-19
272
0
LeetCode 98. Validate Binary Search Tree( 递归,BST )
二叉树
编程算法
题解:所有思路都是去找二叉树中不满足BST性质的节点,找到了,就不符合,找不到就符合。那么怎么去找呢?我提供两种思想。
ShenduCC
2020-02-14
463
0
LeetCode 124 Binary Tree Maximum Path Sum
二叉树
编程算法
https://leetcode.com/problems/binary-tree-maximum-path-sum/description/
ShenduCC
2018-07-24
251
0
LeetCode 117 Populating Next Right Pointers in Each Node II
二叉树
编程算法
Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL.
ShenduCC
2018-07-24
214
0
LeetCode 116 Populating Next Right Pointers in Each Node
二叉树
编程算法
Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL.
ShenduCC
2018-07-24
185
0
LeetCode 114. Flatten Binary Tree to Linked List
二叉树
编程算法
Given a binary tree, flatten it to a linked list in-place.
ShenduCC
2018-07-24
334
0
LeetCode 107. Binary Tree Level Order Traversal II
二叉树
编程算法
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
ShenduCC
2018-07-24
256
0
LeetCode 106. Construct Binary Tree from Inorder and Postorder Traversal
编程算法
二叉树
Given inorder and postorder traversal of a tree, construct the binary tree.
ShenduCC
2018-07-24
319
0
LeetCode 105. Construct Binary Tree from Preorder and Inorder Traversal
二叉树
编程算法
Given preorder and inorder traversal of a tree, construct the binary tree.
ShenduCC
2018-07-24
252
0
LeetCode 110 Balanced Binary Tree
二叉树
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the depth of the two subtrees of every node never differ by more than 1. Example 1: Given the following tree [
ShenduCC
2018-07-04
237
0
LeetCode 102. Binary Tree Level Order Traversal
二叉树
编程算法
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example: Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 return its level order traversal as: [ [
ShenduCC
2018-06-21
265
0
2016天梯模拟赛 进阶题解
https
ios
人工智能
二叉树
L2-005 集合相似度 题目链接: https://www.patest.cn/contests/gplt/L2-005 题目的意思是要求两个集合的交集中互不相同元素的个数和两个集合并集中互不相同的元素的个数 先求交集中互不相同的元素,然后用两个集合互不相同元素个数的和减去,就是并集中的个数 #include <iostream> #include <string.h> #include <stdlib.h> #include <algorithm> #include <math.h> #includ
ShenduCC
2018-04-26
784
0
没有更多了
社区活动
腾讯技术创作狂欢月
“码”上创作 21 天,分 10000 元奖品池!
立即发文
Python精品学习库
代码在线跑,知识轻松学
立即查看
博客搬家 | 分享价值百万资源包
自行/邀约他人一键搬运博客,速成社区影响力并领取好礼
立即体验
技术创作特训营·精选知识专栏
往期视频·千货材料·成员作品 最新动态
立即查看
领券
问题归档
专栏文章
快讯文章归档
关键词归档
开发者手册归档
开发者手册 Section 归档