[EMAIL PROTECTED] wrote: > See, the idea is to build a max balanced tree. > For which, we need to check the height of the tree > only the first time
There is an "on line" algorithm for this problem. An on line algorithm does not need to see all the input in advance. In this case, the on line algorithm can pop nodes from the skewed tree one by one and insert them into the correct place in perfectly balanced tree. Any algorithm that needs to count all the nodes in advance can't be on line. I know that "on line" was not part of the initial spec, but the on line algorithm is simpler than some that have been proposed, so I suggest looking for it. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---
