O(nlogn) Algorithm - Find three evenly spaced ones within binary string

前端 未结 30 2955
刺人心
刺人心 2020-11-28 00:07

I had this question on an Algorithms test yesterday, and I can\'t figure out the answer. It is driving me absolutely crazy, because it was worth about 40 points. I figure

30条回答
  •  眼角桃花
    2020-11-28 00:30

    An adaptation of the Rabin-Karp algorithm could be possible for you. Its complexity is 0(n) so it could help you.

    Take a look http://en.wikipedia.org/wiki/Rabin-Karp_string_search_algorithm

提交回复
热议问题