Today, we talked about Treap. Basically, it is an implementation of the BST with the property that the insertion, deletion, and look-up can all be done in O(log n) in expectation (the construction is randomized). There are also other implementations of BST with these properties such as AVL tree, B-tree, red-black tree, which you may know before.
We showed that for given a set of keys with assigned priority, the corresponding Treap exists and is unique.
We also showed how to insert a new (key, priority) pair into a Treap.
No comments:
Post a Comment