OK. I know. It looks boring. But it's a structure of the things I want to think about when I go through trying to take a problem and mapping it into a iterative program.
好,我知道这看起来有点无聊,但是这是我要去以迭代的方式,去解决一个问题采取的,措施的大致结构。
Well the idea of a hash, in fact, what's called a hash function is to have some way of mapping any kind of data into integers.
我要怎么做?实际上想法还是哈希,通过一个哈希函数,把任何种类的数据都映射成整数。
Well it turns out a bunch of years ago people just decided that if we have the ability to express numbers and we actually care about expressing letters of the alphabet, well we just need some kind of mapping between one and the other, ASCII and so thus was born what's generally called the ASCII.
结果证实,数年前,人们觉得如果我们,有数字表达能力,而我们真正在乎其实是字符的表达,那么我们就需要数字和字符的某种对应关系,于是就有了俗称的。
I think one of the classic ones for strings is called the Rabin-Karp algorithm. And it's simply the same idea that you have a mapping from your import into a set of integers.
我认为字符串哈希,最经典的是Rabin-Karp算法,它只是简单的相同概念,你有一个映射关系将你的输入映射成一组数字。
应用推荐