From ccab5cae4d33c40d7bc684cd0018412a8f27bb8c Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=9B=B7=E8=92=BB?= <34390285+hsfzLZH1@users.noreply.github.com> Date: Sat, 19 Jan 2019 12:06:33 +0800 Subject: [PATCH] Update treap.md MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 添加了非旋式 treap 建树的操作 --- docs/ds/treap.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/ds/treap.md b/docs/ds/treap.md index ea46bb4e..19d4dc6a 100644 --- a/docs/ds/treap.md +++ b/docs/ds/treap.md @@ -49,6 +49,36 @@ node *merge(node *u, node *v) { } ``` +### 建树(build) + +将一个有 $n$ 个节点的序列 $a_i$ 转化为一棵 treap 。 + +定义 ```Merge(x,y)``` 表示将根为 $x$ 和 $y$ 的两棵 Treap 合并成一棵,其根为该函数的返回值。需要保证 $x` ### count 函数 -- 2.11.0