Algorithm to match one input file with given numbers of file

后端 未结 3 733
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-05 09:17

I had an interview last week. I was stuck in one of the question in algorithm round. I answered that question, but the interviewer did not seem convinced. That\'s why I am s

3条回答
  •  灰色年华
    2021-01-05 10:08

    You can create some kind of indexing (example: trie) to summarize the input file. Then you can check how many indices match across documents.

    Eg. Create a trie for input file for length 10. For every string of length 10 (overlapping) in the text files check how many of them match in the trie.

提交回复
热议问题