Assume that I have two AVL trees and that each element from the first tree is smaller then any element from the second tree. What is the most efficient way to concatenate th
One ultra simple solution (that works without any assumptions in the relations between the trees) is this:
Both steps are O(n). The major issue with it is that it takes O(n) extra space.