码迷,mamicode.com
首页 >  
搜索关键字:binary tree zigzag l    ( 23541个结果
LeetCode572另一个树的子树
题目描述 https://leetcode-cn.com/problems/subtree-of-another-tree/ 题解 我写的 两层DFS、双重DFS 其它题解一般也是这个思路 // Problem: LeetCode 572 // URL: https://leetcode-cn.co ...
分类:其他好文   时间:2020-07-26 19:01:52    阅读次数:62
leetcode-----112. 路径总和
链接:https://leetcode-cn.com/problems/path-sum/ 代码 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode ...
分类:其他好文   时间:2020-07-26 19:00:19    阅读次数:52
openlayers6结合echarts4实现迁徙图
效果图如下: 参考GitHub来实现的,更详细的源码以及参数说明见:GitHub 本篇文章的html源码: <!DOCTYPE html> <html> <head> <title>openlayers6结合echarts4实现迁徙图</title> <link rel="stylesheet" h ...
分类:其他好文   时间:2020-07-26 15:58:57    阅读次数:124
「APIO2018」选圆圈(K-D Tree/CDQ+Set)
「APIO2018」选圆圈(K-D Tree/CDQ+Set) Part1 K-D Tree做法 K-D Tree经常用来优化大暴力。。 把圆$(x,y,r)\(视为矩形\)(x-r,y-r,x+r,y+r)\(,依据\)(x,y)$构建K-D Tree 维护K-D Tree每个节点所有矩形最小和最 ...
分类:Windows程序   时间:2020-07-26 15:48:38    阅读次数:85
Count on a tree(主席树+LCA)
题目链接: P2633 Count on a tree solution: LCA好题.询问第k大,不难想到主席树和前缀和思想,对于每个点$x$,我们可以用主席树维护root到$x$上的序列,然后查询$x,y$路径上的第$k$小只需要用前缀和维护权值线段树,用$x+y-lca(x,y)-f[lca( ...
分类:其他好文   时间:2020-07-26 15:45:20    阅读次数:73
力扣-94-二叉树的中序遍历
题目:传送门 方法一、递归 中序遍历:先遍历左子树,在遍历根节点,最后遍历右子树。比较经典的方法是递归。 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeN ...
分类:其他好文   时间:2020-07-26 15:32:51    阅读次数:67
HDU 1325 Is It A Tree?
A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between ...
分类:其他好文   时间:2020-07-26 02:05:42    阅读次数:102
面试题28:对称的二叉树
考察二叉树的遍历。判断前序遍历,与新增的前->右->左遍历结果是否一致。 C++版 #include <iostream> #include <algorithm> using namespace std; // 定义二叉树 struct TreeNode{ int val; struct Tree ...
分类:其他好文   时间:2020-07-26 01:57:55    阅读次数:63
使用nginx限制用户的访问
使用ngx_http_limit_req_module限制用户访问 该模块使用的是漏斗算法来进行限制。 官方的配置示例如下: http { limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s; ... server { ... loca ...
分类:其他好文   时间:2020-07-26 01:34:48    阅读次数:78
LeetCode617合并二叉树
题目链接 https://leetcode-cn.com/problems/merge-two-binary-trees/ 题解 递归解法 解法见代码注释 // Problem: LeetCode 617 // URL: https://leetcode-cn.com/problems/merge- ...
分类:其他好文   时间:2020-07-26 01:03:49    阅读次数:54
23541条   上一页 1 ... 49 50 51 52 53 ... 2355 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!