摘要: 最近预计做一下各种平衡树的题,这是第一部分,就是一类简单的各种操作,由于实在是太简单了,各种数据结构都可以胜任,我就用treap和sbt分别做了一遍平衡树的三大水题,于是这两种数据结构就比较熟练了。 treap就是普通的二叉排序树多满足了一个堆的性质,相当好写,贴一贴三道题的代码:1.hnoi2002 turnover(无敌大水题)#include <stdio.h>#include <stdlib.h>#include <time.h>const int nmax = 32767;int ans, n, tot, root;struct typetreap 阅读全文
posted @ 2011-10-29 11:33 Neroysq 阅读(356) 评论(0) 推荐(0) 编辑