树的数据结构
开学了8
go on
展开
-
二叉树的建立和中序遍历
浙江省赛2021 #include <iostream> #include <vector> using namespace std; const int N = 1e5 + 7; int cnt; int tr[N<<1]; vector<int> vec; void build(int rt, int v, int x) // v 节点数 x 层数 { tr[rt] = v; if(x >= cnt) return; build(rt<原创 2021-09-20 22:01:46 · 67 阅读 · 0 评论 -
最近公共祖先LCA(离线Tarjan+在线倍增+MRQ)
基础理解 全面原创 2021-06-30 15:26:42 · 82 阅读 · 0 评论