数据结构: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 · 130 阅读 · 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 · 186 阅读 · 0 评论