N
N
neji ne2020-04-28 03:38:32
C++ / C#
neji ne, 2020-04-28 03:38:32

How to merge two 2-3 trees?

The situation is as follows: do you need an algorithm for combining two 2-3 trees if their key ranges intersect and is it possible to insert one tree into another at more than one node?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Tikhonov, 2020-04-28
@neejiii

MergeSort comes to mind, in which two ordered "semi-arrays" are merged into one in linear time. You can try the same trick by traversing an ordered tree, then the insertion will still be one element at a time, but not from the root, but from the leaf nodes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question