Pergunta de entrevista da empresa LinkedIn

How to apply the function of finding a string in the text of vim editor?

Resposta da entrevista

Sigiloso

27 de jun. de 2015

I firstly give a brute force solution that runs O(mn) time, which is clearly too slow, and then I give some modifications by cutting branches and eliminating redundant calculations, but still it doesn't make any significant difference on the time complexity. I didn't do this problem well. After the interview I found that there are classic algorithms to solve this problem in linear time, such as KMP and Boyer-Moore, etc.

1