Skip to content

Instantly share code, notes, and snippets.

@NoNews
Last active June 12, 2020 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NoNews/b3bb74a2c564c2bbb23f4fbaff973152 to your computer and use it in GitHub Desktop.
Save NoNews/b3bb74a2c564c2bbb23f4fbaff973152 to your computer and use it in GitHub Desktop.
int indexOf(Object key, int hash) {
...
//next available position for our element = 0
//to show, that we don't have this key, will execute ~0, which is equal -1
int index = binarySearchHashes(mHashes, N, hash);
if (index < 0) {
// hash code not found, "put" operation
return index;
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment