Re: [algogeeks] Re: Query on a tree again!

2013-03-12 Thread Nguyễn Thành Danh
Hi Shashank, It could be. But if the tree has only 2 branches, and A, B lie as two leaf nodes on each branch, there won't be any more leaf position for C. Thus, C has to lie on the path between A and B. Could you give me some hint to find C in O(lgN) though? On Mon, Mar 4, 2013 at 3:19 PM, BackBen

Re: [algogeeks] Query on a tree again!

2013-01-18 Thread Nguyễn Thành Danh
I'm sorry. Maybe you don't get the question. Your method is used to find the nearest C to A and B, but we need to find C such that the distance from C to A and B are as *large* as possible. Thank you for your response, I really appreciate that. And I'm looking forward to getting more ideas from yo

Re: [algogeeks] Re: Amazon Dynamic Programming problem

2013-01-15 Thread Nguyễn Thành Danh
Can you please explain by which theorem you use to find out that? On Sat, Jan 12, 2013 at 11:41 AM, Lucifer wrote: > if (n%3 == 0) > "Player 1 will lose" > else > "Player 1 will win. The no. of balls picked in the first turn will > be n%3" > --