MCPcopy Create free account
hub / github.com/careercup/ctci / getFrequency

Method getFrequency

java/Chapter 17/Question17_9/Question.java:21–30  ·  view source on GitHub ↗
(Hashtable<String, Integer> table, String word)

Source from the content-addressed store, hash-verified

19 return table;
20 }
21 public static int getFrequency(Hashtable<String, Integer> table, String word) {
22 if (table == null || word == null) {
23 return -1;
24 }
25 word = word.toLowerCase();
26 if (table.containsKey(word)) {
27 return table.get(word);
28 }
29 return 0;
30 }
31
32 public static void main(String[] args) {
33 String[] wordlist = AssortedMethods.getLongTextBlobAsStringList();

Callers 1

mainMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected