mockers
Would you like to react to this message? Create an account in a few clicks or log in to continue.

circular permutation

2 posters

Go down

circular permutation Empty circular permutation

Post  mnnit.rahul Tue Feb 03, 2009 3:14 am

find whether a given string is circular permutation of another string or not

mnnit.rahul

Posts : 51
Join date : 2009-02-01

Back to top Go down

circular permutation Empty Re: circular permutation

Post  Beagle Tue Feb 03, 2009 10:40 am

string s1 = <any-string>;
s2 = s1 + s1;
now check for the given string as substring of s2. (matlab eg. let <any-string> be abcd.... and we have to check whether cdab is a circular permutation of abcd.
s2 = abcdabcd
now i have to search cdab as substring of s2. Smile )

Beagle

Posts : 40
Join date : 2009-01-30

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum