Блог пользователя striker_46

Автор striker_46, история, 2 недели назад, По-английски

I am learning the alogorithm of prefix_function i get the algorithm but unable to understand the time complexity of the algorithm why the time complexity is o(n) can anyone explain the time complexity of algo.

  • Проголосовать: нравится
  • -9
  • Проголосовать: не нравится

»
2 недели назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

TC:O(n) AND NOT O(n^2) since the decrease in the LPS is bounded by the increase and increase is very gradual so worst case O(2n)