李晓亮的博客

导航

2010年6月21日

【转】随机二叉搜索树 Treap

摘要: (当个日记记录Treap这一结构,详细参见http://www.nocow.cn/index.php/Treap, 在这里我着重讲一下旋转) Treap,它其它就是一个二叉查找树(BST)+堆(HEAP). 它的数据有两个:关键值(key),优先级(fix). 用struct表示Treap的结点的结构如下: struct node { datatype key; int fix; node * ... 阅读全文

posted @ 2010-06-21 00:26 LeeXiaoLiang 阅读(439) 评论(0) 推荐(0) 编辑