Why are we thinking of suffix tree in this case. Does not make sense.
It the password is valid then it is of length between 5-12 only.
Simple brute force approach will give decent time enough + we will not
waste necessary memory and large line of code.

On Wed, Jun 29, 2011 at 10:38 PM, Swathi <[email protected]> wrote:

> Please provide the psuedo code for suffix array or suffix trees which does
> this.. I got this question in amazon online test... We need to write code,
> compile and test in amazon online test..
>
>
> On Wed, Jun 29, 2011 at 10:36 PM, rajat ahuja 
> <[email protected]>wrote:
>
>> i think
>> we need to form suffix array of the given string with one extra
>> information tht is frm which index we are considerin suffix
>> then sort those uffixe pointres
>> after tht single scan wud do the job
>> thanks
>> rajat ahuja
>>
>> On Wed, Jun 29, 2011 at 10:23 PM, Swathi <[email protected]> wrote:
>>
>>> Write the implementation of isPasswordValid() function which return true
>>> if the following conditions matches
>>> 1) If password length is between 5 to 12 characters
>>> 2) It should be alpha numerics
>>> 3) There  should not be any consecutive substrings
>>> ex - ab12abc [valid as there are no consecutive substrings]
>>> ex - ab12abcabc [not valid as "abc" is consecutive substring].
>>>
>>> Can someone provide the pseudo code with the logic..
>>>
>>> Thanks,
>>> Swathi
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to