Re: [algogeeks] Re: Find the maximum boxes which can fit each other?

2012-04-08 Thread bharat b
@saurabh : I didn't understand. will u give an ex:. if it is a graph(not tree), how can u find longest path in O(n). On Thu, Apr 5, 2012 at 5:45 PM, Doom duman...@gmail.com wrote: @Don: Any ideas which oppose the above proposed solution? On Saturday, 24 March 2012 21:52:49 UTC+5:30, Don

Re: [algogeeks] Doubt on Regular Expression

2012-04-08 Thread bharat b
In regular expr, even a space is also a character. so u can exclude all those spaces(stay in the same state if u encounter a space character) in a word. On Wed, Apr 4, 2012 at 5:05 PM, atul anand atul.87fri...@gmail.com wrote: i am not sure , but wont x.trim() will remove extra spaces from the

[algogeeks] How many games you will conduct to decide a winner for N players. Visualize in terms of a Data Structure.

2012-04-08 Thread Suhas Rao
Hi Team, I have the following question. Could any of you answer this? *Interview Question:* *How many games you will conduct to decide a winner for N players. Visualize in terms of a Data Structure. * Is there any mathematical calculation to decide the winner among N-players? Game is 1 against

Re: [algogeeks] How many games you will conduct to decide a winner for N players. Visualize in terms of a Data Structure.

2012-04-08 Thread SAMM
This can be done using Tournament Tree ... PLzz refer wiki or http://www.geeksforgeeks.org/archives/11556 ... This will surely help .. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] GPU doubt

2012-04-08 Thread Arun Vishwanathan
Thanks IIya On Sat, Apr 7, 2012 at 3:53 PM, Ilya Albrekht ilya.albre...@gmail.comwrote: I'm absolutely didn't get your explanation... What is the connection between O(n^3) algorithms and staff you are talking about? On Saturday, 7 April 2012 03:22:29 UTC-7, SAMMM wrote: This is becoz the

[algogeeks] Re: Find border of a binary tree.

2012-04-08 Thread Gene
Good question. The problem is not well-defined. It's possible that 75 should be omitted because there are deeper subtrees to the left and right. But we'll never know for sure because examples don't make a good definition. On Apr 8, 2:29 pm, atul anand atul.87fri...@gmail.com wrote: i guess

[algogeeks] Re: Find border of a binary tree.

2012-04-08 Thread Doom
75 is omitted because its the border. Think of border like putting an elastic rubber band around the tree. Print the nodes being touched by the rubber. On Monday, 9 April 2012 08:12:48 UTC+5:30, Gene wrote: Good question. The problem is not well-defined. It's possible that 75 should be

Re: [algogeeks] Re: Find border of a binary tree.

2012-04-08 Thread atul anand
then one way to do this would be something like this :- find h1=maxHeight of root-left find h2=maxHeight of root-right leave root and first print left and right subtree of the root now call print(root-left) a) if root-left==NULL root-right!=NULL currentHeighth1 then print current

Re: [algogeeks] Re: Find border of a binary tree.

2012-04-08 Thread atul anand
@above : correction in now call print(root-right) , highlighted below a) if root-right==NULL *root-left!=NULL* currentHeighth2 On Mon, Apr 9, 2012 at 10:53 AM, atul anand atul.87fri...@gmail.com wrote: then one way to do this would be something like this :- find h1=maxHeight of root-left

Re: [algogeeks] Re: Find border of a binary tree.

2012-04-08 Thread atul anand
above you need to print only those leaf nodes which are at height h1 or h2. actually some of the cases are missed in above algo.which would result in wrong output. i will post the solution , once taking into account of all cases. On Mon, Apr 9, 2012 at 10:56 AM, atul anand atul.87fri...@gmail.com