From ce18b653623b14a6b67cfa3f63cfb7596c796f4a Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Wed, 11 Dec 2019 10:37:30 -0600 Subject: Change hash function to also correct one --- csci1913/Java/lab13_strap012.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'csci1913/Java') diff --git a/csci1913/Java/lab13_strap012.java b/csci1913/Java/lab13_strap012.java index e5ce45d..8645a98 100644 --- a/csci1913/Java/lab13_strap012.java +++ b/csci1913/Java/lab13_strap012.java @@ -16,7 +16,7 @@ class Test private static int hash(String name) { - return (name.charAt(0) + name.charAt(name.length()-1)) * name.length() % 1023; + return ((name.charAt(0) + name.charAt(name.length()-1)) * name.length()) % 255; } public static void main(String [] args) -- cgit v1.2.3