Created
March 30, 2016 22:35
-
-
Save amckinley/22092062d32a6850fc378fbe0a42a4f8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String toString() { | |
String result = ""; | |
for (int i = 0; i < this.numBuckets; i++) { | |
LinkedList<Map.Entry<K, V>>> current = this.internalList.get(i); | |
String bucketStatus; | |
if (current == null) { | |
bucketStatus = "bucket " + i + " is empty"; | |
} else { | |
bucketStatus = "bucket " + i + " has " + current.size() + " items"; | |
} | |
result.append(bucketStatus); | |
} | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment