Treap with implicit keys

后端 未结 4 469
滥情空心
滥情空心 2020-12-15 10:10

There\'s a data structure called treap: that\'s a randomized binary search tree, which is also a heap on randomly generated so-called \"priorities\".

There\'s a vari

相关标签:
4条回答
  • 2020-12-15 10:29

    Maybe you are looking for a Rope (complex form of string) modified to your needs for delayed operations. Interesting thing is that there is an open question regarding ropes right here right now.

    0 讨论(0)
  • 2020-12-15 10:30

    I don't think there is a name for that data structure since it is simply a combination of two orthogonal concepts. You could use implicit keys like this with just about any self-balancing tree data structure.

    You might want to take a look at Scapegoat trees, since they use the subtree size already for rebalancing and do not require any per-node overhead.

    0 讨论(0)
  • 2020-12-15 10:34

    You can find this data structure in the paper by Kaplan and Verbin on sorting signed permutations by reversals (page 7, section 3.1): http://www.math.jussieu.fr/~fouquet/ENSEIGNEMENT/PROJETS/kaplan.pdf.

    0 讨论(0)
  • 2020-12-15 10:48

    The key idea (no pun intended!) in treaps is to use keys, which are randomized. If you remove the keys, I don't see how you can have a treap: so perhaps I misunderstood your question. Or perhaps you are referring to the alternative to treaps, the randomized binary search tree. Both data structures use the same idea that you can attain average-case complexity by making sure your tree looks like an average tree (instead of a pathological case).

    With the treaps, you do this using random priorities and balancing.

    With randomized binary trees, the randomness is solely included during the construction: that is, when you insert a node in tree T, it has probability 1/(size(T) + 1) to be at the root, where size(T) is the number of nodes of T; and of course if the node is not inserted at the root, you continue recursively until it is added. (See articles my C. Martinez for a detailed study of these trees.)

    This data structure behaves exactly like a treap, but uses a different mechanism that does not require keys.

    If this is not what you were looking for, perhaps you could share some additional information: did your lecturer mention anybody who might have worked on this structure, where did you here this lecturer and what his/your nationality. It might not seem like it, but knowing your native tongue could be an important clue as you can generally peg down algorithms/data structures to a specific country that originated it.

    0 讨论(0)
提交回复
热议问题