dandf2012's blog

By dandf2012, history, 6 years ago, In English

Normally when we do string hashing, we use values 1...26. Can we do such a hash for values 1...N where N is 50000? I think it is maybe more error, but is there some bound on N for which we can safely use polynomial hash?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By dandf2012, history, 6 years ago, In English

In many dp, such as knapsack, there is a often a state dp[i][...] such that i is first i numbers. Why is that? Why might it be so convenient for such a state?

Full text and comments »

Tags dp
  • Vote: I like it
  • -18
  • Vote: I do not like it