mirror of
https://github.com/krahets/hello-algo.git
synced 2026-11-12 00:39:48 +08:00
Retranslate the complete English edition from Simplified Chinese (#2010)
* Retranslate the complete English edition from Simplified Chinese * Polish three English explanations after reader-focused review
This commit is contained in:
@@ -37,7 +37,7 @@ public class simple_hash {
|
||||
return hash & MODULUS;
|
||||
}
|
||||
|
||||
/* Rotational hash */
|
||||
/* Rotating hash */
|
||||
static int rotHash(String key) {
|
||||
long hash = 0;
|
||||
final int MODULUS = 1000000007;
|
||||
@@ -48,18 +48,18 @@ public class simple_hash {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String key = "Hello Algo";
|
||||
String key = "Hello 算法";
|
||||
|
||||
int hash = addHash(key);
|
||||
System.out.println("Additive hash value is " + hash);
|
||||
System.out.println("Additive hash value: " + hash);
|
||||
|
||||
hash = mulHash(key);
|
||||
System.out.println("Multiplicative hash value is " + hash);
|
||||
System.out.println("Multiplicative hash value: " + hash);
|
||||
|
||||
hash = xorHash(key);
|
||||
System.out.println("XOR hash value is " + hash);
|
||||
System.out.println("XOR hash value: " + hash);
|
||||
|
||||
hash = rotHash(key);
|
||||
System.out.println("Rotational hash value is " + hash);
|
||||
System.out.println("Rotating hash value: " + hash);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user