
数据结构:Treap Tree
文章平均质量分 77
skajre
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Treap树
#include #include #include #include using namespace std; struct Node{ Node *ch[2]; int v,r,s; int cmp(int x) const { if(x==v) return -1; return x<v?0:1; } void main原创 2016-10-28 17:44:15 · 164 阅读 · 0 评论 -
UVA 1479 Graph and Queries(Treap树)
首先把最终图弄出来,然后逆序命令即可。#include struct Node{ Node *ch[2]; int v,r,s; Node(int v): v(v) {ch[0]=ch[1]=NULL;r=rand();s=1;} int cmp(int x) const { if(x==v) return -1; return x<原创 2016-10-28 21:05:19 · 221 阅读 · 0 评论