这是使用节点的哈希表实现的一部分,但我不知道您将如何实现此方法?
//Convert a name to a key using radix-26:
//Use all of the letters of the alphabet as your digits.
//Assume we only deal with lower-case letters for simplicity.
//Then you can create the radix(base)-26 alphabet number system.
//For example:
// "alice" in radix-26 is 26^4*1 + 26^3*12 + 26^2*9 + 26^1*3 + 26^0*5 = 674055
// "zoe" in radix-26 is 26^2*26 + 26^1*15 + 26^0*5 = 17971
public static long nameToKey(String name) {
long key = 0;
/**
* TODO
*/
return 0;
}