⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 myhashfunction.java

📁 用java编写的hashtable程序
💻 JAVA
字号:
/**
A class for determining the index of a word using unicode
Written by : H Yu
*/

public class MyHashFunction {
	
	/**
	*class method returns the index of word w
	*@param w word
	*/
	public static int HashFunction(String w,int d) {
		String word = w;
		int l = word.length();
		int sum=0;
		for (int i=0;i<l;i++) {
			char ch = word.charAt(i);
			int value = Character.getNumericValue(ch);
			sum+=value;
		}
		return(sum%d);
	}
}
		

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -