Re: [algogeeks] Re: Permutations of a string

2012-05-08 Thread Sairam Ravu
Thanks Gene. -- 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, visit this

Re: [algogeeks] Re: Sorting in O(n)

2012-05-08 Thread saurabh singh
what he wanted to say was that first digit would be m/n and second digit m%n Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Tue, May 8, 2012 at 10:31 AM, atul anand atul.87fri...@gmail.com wrote: @arpit : your formula for converting base 10 to base n is

Re: [algogeeks] Re: Sorting in O(n)

2012-05-08 Thread Mahesh Thakur
I think if range is till n2, max passes for radix sort will be 3. by subtracting 1 to all the numbers we get the max range to n2-1 and radix sort can be done in 2 passes. but what will happen when if we have a '0' in array and then we subtract 1 to it? On Tue, May 8, 2012 at 9:48 AM, atul anand

Re: [algogeeks] Permutations of a string

2012-05-08 Thread Pralay Biswas
Nice solution Akshay. Here is my small attempt! [image: Inline image 1] #Pralay On Mon, May 7, 2012 at 1:03 AM, Akshay Rastogi akr...@gmail.com wrote: private static void swap(char[] str, int i,int j) { char temp = str[i]; str[i] = str[j]; str[j] = temp; }

Re: [algogeeks] Re: Sorting in O(n)

2012-05-08 Thread saurabh singh
Read the problem for constraints Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Tue, May 8, 2012 at 11:12 AM, Mahesh Thakur tmahesh...@gmail.com wrote: I think if range is till n2, max passes for radix sort will be 3. by subtracting 1 to all the

Re: [algogeeks] Re: find a point closest to other points

2012-05-08 Thread pacific :-)
On Tue, May 1, 2012 at 8:44 PM, Bhupendra Dubey bhupendra@gmail.comwrote: Find the centroid X= (x1 +x2xn)/N Y=(y1+y2..yn)/N This will precisely be the point no need to calculate and check with distance. @dubey : Consider this case, let there be a cluster of 4 points near the

Re: [algogeeks] how to code a deterministic or Non-Deterministic finite state automata model?

2012-05-08 Thread pacific :-)
How about using function pointers ? On Fri, Apr 6, 2012 at 11:09 PM, Doom duman...@gmail.com wrote: Any pointers to a code using NFA / DFA computation model? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the

Re: [algogeeks] algorithm that returns number of internal nodes in the tree

2012-05-08 Thread Akshay Rastogi
you are not checking whether the current node is an internal node or not !! On Thu, May 3, 2012 at 12:47 AM, Rose itro...@gmail.com wrote: Is this algorithm right or how shall I write it? * * * * *Construct an algorithm **Intern(**x**)**, which returns the number of internal nodes in