テキスト ファイル (数百万単位) に URL のリストがあり、テキスト ファイルにブラックリストに登録された単語を含む別のリストがあるとします。
URLのリストに対して次の処理を実行したいと考えています。
- Parse the URLs and store them in some DS
- Process the URLs and blacklist those URLs which contain atleast one of the
blacklisted words.
- If there exists a URL containing 50% or more blacklisted words, add the other
words of that URL in the list of blacklisted words.
- Since now the blacklisted words list has been modified then it's probable
that the URLs which were not blacklisted earlier can get blacklisted now. So,
the algorithm should handle this case as well and mark the earlier whitelisted
URLs as blacklisted if they contain these newly added blacklisted words.
最後に、ホワイトリストに登録された URL のリストが必要です
最も効果的な時間と空間の複雑さの解決策を達成するために使用できる最良のアルゴリズムと DS は何か提案はありますか?