i think we cannot change the order of the characters
On Thursday, 19 July 2012 11:00:20 UTC+5:30, gobind hemb wrote:
String s is called *unique* if all the characters of s are different.
String s2 is *producible* from string s1, if we can remove some
characters of s1 to obtain s2.
String
You could do this too...
1. Sort the words based on length. Max Time: O(nlogn)
2. Now, Create a tree similar to a state transition diagram. For each word
in the tree, store their start and end pointers.
3. If a word comprises of another word, then the main word would only store
start and end
The very fact that the complexity is O(nlogn) doesn't hold good since the
comparison operation takes O(length of string).
Can you give us more details on the algorithm?
On Wed, May 21, 2008 at 11:32 AM, Chonku [EMAIL PROTECTED] wrote:
You could do this too...
1. Sort the words based on
Well, he does say other words. hippopotamuses is not made up of
other words in the list.
It looks like a recursive procedure would do the trick. It might help
to sort the word list into order by length. Then beginning with the
longest word, find other words that match the beginning of the word.
Regular expressions ?
--~--~-~--~~~---~--~~
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 [EMAIL
You can solve this problem by the following technique:
Proc 1: Take any word W in the file
Find all strings S(k) which are formed by concatenating k words in the file
and is a prefix of W. [A word can repeat multiple times in different places]
As you can see, number of words in S(k) will
Does anyone has any ideas on how to solve it?
--~--~-~--~~~---~--~~
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,
The following is a statement of a programming problem i encountered
I don't know how to solve it.
Any ideas??
The owner of shop Jell Bells has order a large consignment of jell
balls which is about to arrive. He has
hired you as an assistant to help him sort the balls and put them in
their