Given two binary search trees, is there an algorithm to combine them into a single binary search tree with linear time complexity?
I thought about putting the elements of the second tree into the first tree one by one but failed to achieve it in linear time complexity.