Functions for joining AVL trees.
Join two AVL trees. This is the AVL equivalent of (++).
asListL (l `join` r) = asListL l ++ asListL r
Complexity: O(log n), where n is the size of the larger of the two trees.
Concatenate a finite list of AVL trees. During construction of the resulting tree the input list is consumed lazily, but it will be consumed entirely before the result is returned.
asListL (concatAVL avls) = concatMap asListL avls
Complexity: Umm..Dunno. Uses a divide and conquer approach to splice adjacent pairs of trees in the list recursively, until only one tree remains. The complexity of each splice is proportional to the difference in tree heights.