Concatenating red-black trees

后端 未结 4 1760
迷失自我
迷失自我 2021-01-31 10:22

The OCaml standard library has a wonderful Set implementation that uses a very efficient divide-and-conquer algorithm to compute the union of two sets.

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-31 11:29

    You may win something when you'll combine tree with low overlap, but in general you'll have to reorgainze nodes. With balancing you have worse situation as there probably rules for rotating after touching only one node.

提交回复
热议问题