Re: [algogeeks] Permutation of Array.

2010-08-19 Thread Divya Chandrasekar
Never mind. This algo doesn't work properly. Apologies. On Thu, Aug 19, 2010 at 3:34 PM, Divya Chandrasekar wrote: > By the algo I gave : > > 1. Grouping - > 3 digits - 111 > 1 digit - 6,5,9 > > 2. Sorting within each bucket > 3 digits - 111 > 1 digit - 5,6,9 &g

Re: [algogeeks] Permutation of Array.

2010-08-19 Thread Divya Chandrasekar
By the algo I gave : 1. Grouping - 3 digits - 111 1 digit - 6,5,9 2. Sorting within each bucket 3 digits - 111 1 digit - 5,6,9 3. Concatenation by descending order of number of digits, and increasing order within each digit bucket - Grouping would then be - 3 digit numbers in sorted order follow

Re: [algogeeks] Permutation of Array.

2010-08-19 Thread Divya Chandrasekar
Another method - 1. Group the numbers according to the number of digits (maybe hash buckets) 2. Sort in ascending order within each bucket (any efficient sorting algo) 3. Concatenate them by descending order of number of digits, and ascending order within the group. On Thu, Aug 19, 2010 at 7:37

Re: [algogeeks] Re: Longest Palindromic Substring

2010-08-19 Thread Divya Chandrasekar
A substring is continuous, whereas a subsequence is discontinuous. alevela is a palindromic subsequence, and not a substring. On Thu, Aug 19, 2010 at 11:45 AM, Saikat Debnath wrote: > Isn't the longest palindromic substring is alevela??? > > On Aug 19, 7:16 pm, Nikhil Jindal wrote: > > Hi All, >