Hi,
I want to know how to merge two AVL trees where elements of the first tree is smaller than all elements of second AVL tree how can I do that in O(log N) of course preserving the balance factor .
aslo how to split one AVL tree into two AVL trees where elements of the first is less than or equal K and elements of the second AVL tree is bigger than K also with preserving the balance factor.
thanks for helping me.
Good question. I will learn it and give a solution.
Here is the solution: https://i.cs.hku.hk/~provinci/training2016/AVL/Main.java
Good work Sir but next time, check when the blog was posted. It is 4 years old :) I'm sure kingofnumbers now knows how to do it!
but but .. it could be helpful to others ;):)