[algogeeks] Merging Companies Problem

2010-07-31 Thread sourav
Suppose we start with n companies that eventually merge into one big company. How many different ways are there for them to merge? With three companies {a,b,c}, we need to find the number of ways that the three companies can become two companies, and for every one of those possibilities, the two

Re: [algogeeks] Merging Companies Problem

2010-07-31 Thread Nikhil Jindal
For merging n companies, F(n) = n*F(n-1) for n 3. Base case, F(3) = 3. On Sat, Jul 31, 2010 at 6:59 PM, sourav souravs...@gmail.com wrote: Suppose we start with n companies that eventually merge into one big company. How many different ways are there for them to merge? With three companies

Re: [algogeeks] Merging Companies Problem

2010-07-31 Thread sharad kumar
Cant u slit it s n/2 companies and merge them recursively .like x^y the multiply x to y/2 time and then multiply tht product twice. On Sat, Jul 31, 2010 at 6:59 PM, sourav souravs...@gmail.com wrote: Suppose we start with n companies that eventually merge into one big company. How many