maintain a hash table with keys as the set of keywords and values as a
boolean value initialized with false.
initialize a counter count with 0
let n be the total number of keywords.
start comparing the words of the text with keywords.
If word matches with keyword then
{
go to hash table and
 if value is false make it true and increment count by 1.
if value is true then do nothing
once count becomes n.we have found the subtext.
}
else {
go to next word of the text
}

On Feb 13, 5:16 am, conundrum <[EMAIL PROTECTED]> wrote:
> Given a text and a set of keywords, is there a linear time algorithm
> to find the smallest subtext containing all the keywords (at least
> once) ?
--~--~---------~--~----~------------~-------~--~----~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to