On Apr 13, 1:23 am, gagan.singh.ar...@gmail.com wrote:
I had a test today and there was a question regarding how to merge two
AVL trees to form another AVL tree without using any AVL tree
operations. Some had done it by using an array, sorted the elements
and then formed the tree. Is there any sort of 'appropriate' algorithm
for doing this? (This seems sort of brute force).
You want news:comp.programming, where you will (no doubt) run into Ben
Pfaff (who is quite the AVL tree expert).
I guess that merging two properly formed AVL trees can be a lot more
efficient than simply cramming the smaller tree into the larger, one
object at a time, if there is a merge() function.
But your question is not a C question but an algorithm question.
While news:comp.programming is not exactly an algorithms group, it's
the closest thing that I know of.