ayushmishra.iit's blog

By ayushmishra.iit, history, 9 years ago, In English

I have a string of length n. I could have queries like query(i, j) which should return the hash of the sub-string starting at i and ending at j inclusive. This query should be answered in O(1). And a preprocessing of o(n) or o(n log n) is allowed initially.

Can anyone give me idea how to do such thing?

Full text and comments »

  • Vote: I like it
  • -4
  • Vote: I do not like it