Re: [algogeeks] Re: Doubt in removing loop from linked list

2012-03-10 Thread rahul sharma
@dave...yeah got it thnx... @sanjiv...i have explained ... On Sat, Mar 10, 2012 at 10:09 AM, sanjiv yadav sanjiv2009...@gmail.comwrote: actually how u r moving from 7 to 4? can tell me in the detail... On Sat, Mar 10, 2012 at 4:37 AM, Dave dave_and_da...@juno.com wrote:

Re: [algogeeks] Re: find longest common contiguous intersection from 2 lists

2012-03-10 Thread payal gupta
first of all ,its not suffix array bt suffix tree..vich i mistyped...sorry 4 dat..n yeah!!! d question demands the samebt d same question cud also b solved by suffix trees the implementation of vich i require as there is some flaw in ma implementation... so ,i vud b thankful if ny has shares

Re: [algogeeks] Doubt in removing loop from linked list

2012-03-10 Thread rahul sharma
1-2-3-4-5-6-7-8-9-10-11 fast and slow meet at 11 m=6; k=4 ...i cant get last two lineswhen k= sometimes around the circle - m.. then after that taking fast at begining and slow within circle ..i cant get this...@ dave plz explain with this example...will b of gr8 help..thnx in

[algogeeks] Re: RBS internship paper

2012-03-10 Thread deepikaanand
NSIT On Mar 10, 12:50 pm, saurabh arora saurabharora8...@gmail.com wrote: which college -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send

[algogeeks] saurabh singh wants to chat

2012-03-10 Thread saurabh singh
--- saurabh singh wants to stay in better touch using some of Google's coolest new products. If you already have Gmail or Google Talk, visit: http://mail.google.com/mail/b-8b1926b47c-1a94807712--9DQx1eW2o_LPykR-fUVx5lOG1s You'll

Re: [algogeeks] Doubt in removing loop from linked list

2012-03-10 Thread Moheed Moheed Ahmad
@Rahul: As Dev said: Now start the fast pointer at the head and take m single steps with both pointers. The fast pointer is at the beginning of the cycle, and the slow pointer has traversed the cycle (2*t - u) times and is back at the beginning of the cycle. k= (2*t-u)p -m When fast pointer is

Re: [algogeeks] A strange doubt with cpp class. Why compile error ?

2012-03-10 Thread Moheed Moheed Ahmad
Isn't Abc() a constructor which means to construct the object. No need for new.. -Cheers Moheed I am who I am, no matter where I am or who I am with. * * On Fri, Mar 9, 2012 at 9:16 PM, atul anand atul.87fri...@gmail.com wrote: may u r confused with java Abc a ; // this itself is

Re: [algogeeks] Doubt in removing loop from linked list

2012-03-10 Thread rahul sharma
@moheed i got it. @Dave...Thnx a lot..i got it all now... On Sat, Mar 10, 2012 at 5:56 PM, Moheed Moheed Ahmad mohe...@gmail.comwrote: @Rahul: As Dev said: Now start the fast pointer at the head and take m single steps with both pointers. The fast pointer is at the beginning of the cycle,

[algogeeks] Print all permutation of string

2012-03-10 Thread rahul sharma
plz xplain logic and if possible plz post ths algo too...thnx in advance -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to

Re: [algogeeks] Print all permutation of string

2012-03-10 Thread Senthil Nathan
Well it would take n! as you have to print all the permutations and you will have to swap positions to find the next permutation from the current permutation and you need to do it in a orderly fashion so that you don't have to keep track of the permutations you have already produced to prevent

Re: [algogeeks] Print all permutation of string

2012-03-10 Thread rahul sharma
plz explain this program... http://www.geeksforgeeks.org/archives/767 On Sat, Mar 10, 2012 at 7:09 PM, Senthil Nathan senthilma...@gmail.comwrote: Well it would take n! as you have to print all the permutations and you will have to swap positions to find the next permutation from the current

Re: [algogeeks] Print all permutation of string

2012-03-10 Thread atul anand
this might help :- http://www.youtube.com/watch?v=NdF1QDTRkcklist=PLFE6E58F856038C69index=10feature=plpp_video On Sat, Mar 10, 2012 at 9:11 PM, rahul sharma rahul23111...@gmail.comwrote: plz explain this program... http://www.geeksforgeeks.org/archives/767 On Sat, Mar 10, 2012 at 7:09

[algogeeks] Re: Print all permutation of string

2012-03-10 Thread Don
The simple form of the algorithm works like this: Select one character of the string to be the first character in the permutation. Now permute the remaining characters. Repeat selecting a different first character until you have used them all. The code is simple: permute(char *string, char

Re: [algogeeks] Re: RBS internship paper

2012-03-10 Thread shruthi sharma
can we apply off-compus?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options,

[algogeeks] Java question

2012-03-10 Thread shruthi sharma
Hi, Im new to algorithms, so this might be a simple question for most of you Lets say there are 5 trucks, each of which can take 100kg load. And they are filled to some extent randomly. Let the free quantity be 40kg, 30kg, 20kg, 80kg, 60kg respectively. At any given time only single load comes.

[algogeeks] Re: Java question

2012-03-10 Thread shruthi sharma
I implemented it by using arraylist. I sorted the trucks according to the free space and when a load comes I iterated till the point, say j where I find a suitable space and then sorted it with the elements till j. I want to know if I can optimize it even further if possible. I want to know if

Re: [algogeeks] Re: Java question

2012-03-10 Thread saurabh singh
Is it possible items are removed from the truck too? Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Sat, Mar 10, 2012 at 9:39 PM, shruthi sharma shruthi.shar...@gmail.comwrote: I implemented it by using arraylist. I sorted the trucks according to the

Re: [algogeeks] Re: Java question

2012-03-10 Thread Bhavani Pradeep
yeah.. they can be removed too On Sat, Mar 10, 2012 at 10:41 PM, saurabh singh saurab...@gmail.com wrote: Is it possible items are removed from the truck too? Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Sat, Mar 10, 2012 at 9:39 PM, shruthi

Re: [algogeeks] Re: Java question

2012-03-10 Thread Bhavani Pradeep
and i guess there can be multiple input loads too... i saw the same question elsewhere too -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send

Re: [algogeeks] Re: Java question

2012-03-10 Thread atul anand
how about going through every truck and doing temp=(free_space - load); if(temp min temp =0) { min=temp; truck = i; } now after traversing we have found the truck where we can add load. no need of sorting complexity =O(n) where n is number of trucks space complexity = constant On

[algogeeks] Graph problem - cut vertex

2012-03-10 Thread atul anand
how to find all cut vertexes in a given graph ?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to

[algogeeks] Maximum height/depth of tree

2012-03-10 Thread rahul sharma
http://www.geeksforgeeks.org/archives/646 Plz tell that the link i have given in this mail for tree height...isn't the tree height is 2 in this???height is the longest path...n in path we include the number of edges or nodes??acc. to me its number of edges in longest path...plz tell..thnx in

Re: [algogeeks] Maximum height/depth of tree

2012-03-10 Thread Moheed Moheed Ahmad
should be 2. -Cheers, Moheed I am who I am, no matter where I am or who I am with. * * On Sun, Mar 11, 2012 at 11:04 AM, rahul sharma rahul23111...@gmail.comwrote: http://www.geeksforgeeks.org/archives/646 Plz tell that the link i have given in this mail for tree height...isn't the tree

[algogeeks] Re: Maximum height/depth of tree

2012-03-10 Thread Sonia Keys
Correct is always whatever the specification says. You may think something else is more conventional, or something else may seem right to you, but none of that matters if there are clear instructions otherwise. -- You received this message because you are subscribed to the Google Groups

[algogeeks] Re: Doubt in removing loop from linked list

2012-03-10 Thread Varun
Yes, if they meet then its a loop, but in later case, they won't meet in case where loop has anything more than 1 element. here one ptr is at meeting point, and second is at start of loop, but the distance between them isn't always one, its the number of elements in the loop. Now when u move each

Re: [algogeeks] Re: Maximum height/depth of tree

2012-03-10 Thread rahul sharma
but according to the o/p it should be 3i also concerned from the data structure and algo book it is also giving same answer.so the height/depth is the number of nodes in largest pathis it rigt??? On Sun, Mar 11, 2012 at 12:10 PM, Sonia Keys soniak...@gmail.com wrote: Correct is

[algogeeks] Finding majority element(which is ocuuring more than n/2 imes in array)

2012-03-10 Thread rahul sharma
*refered from:-http://www.geeksforgeeks.org/archives/503 basically want to know that whether voting algo is corret??? *2,2,2,3,3,4,4 in this case it is giving majority element as 4 but it should be 3???plz explain. * METHOD 3 (Using Moore’s Voting Algorithm)* This is a two step process. 1. Get

[algogeeks] Re: Finding majority element(which is ocuuring more than n/2 imes in array)

2012-03-10 Thread rahul sharma
can be done easily with hashing..btu takes extra space. cant we simplify just by one step. On Sun, Mar 11, 2012 at 12:46 PM, rahul sharma rahul23111...@gmail.comwrote: *refered from:-http://www.geeksforgeeks.org/archives/503 basically want to know that whether voting algo is