【数据结构与算法】Treap的Java实现
生活随笔
收集整理的這篇文章主要介紹了
【数据结构与算法】Treap的Java实现
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Treap
- Article1
- Article2
隨機數生成器
- 隨機數生成器
Treap的功能介紹
- void insert(x) → Insert x
- void remove(x) → Remove x
- boolean contains(x) → Return true if x is found
- Comparable findMin() → Return smallest item
- Comparable findMax() → Return largest item
- boolean isEmpty() → Return true if empty; else false
- void makeEmpty() → Remove all items
- void printTree() → Print tree in sorted order
異常類
當集合容器為空的時候就不能夠刪除或獲取元素,這時就會出現一種異常,命名為UnderflowException:
/*** Exception cl總結
以上是生活随笔為你收集整理的【数据结构与算法】Treap的Java实现的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【OJ】洛谷数组题单题解锦集
- 下一篇: 路径计数2(洛谷P1176题题解,Jav