[algogeeks] Re: Complexity of searching in this alternate representation of tree

2010-04-10 Thread flair-kun
A binary search tree, nodes are ordered. So if you go to the left subtree the data in all of the nodes is less than the data in current node. Going to right subtree all the data will be greater than the data in current node. In short we need to define an order in that tree (how is the data arrange

[algogeeks] Re: combination problem

2010-04-10 Thread flair-kun
Hey, I think the following argument works, but there might be a better way: First consider the problem: x1 + x2 + ... = N, where xi's are non- negative. Soln: Let us assume we have N balls that we must separate into k groups (xi = number of balls in the ith group). If we represent each ball by "O