reading-notes

code fellows reading notes

View on GitHub

Reading-Notes

Code Fellows Python 401

Read: Data Structure and Analysis - Hash Tables

Common Terminology:

Uses

Hashtables

Structure

Hashing

Creating a Hash

ex.

Key = "Cat"
Value = "Josie"

67 + 97 + 116 = 280

280 * 599 = 69648

69648 % 1024 = 16

Key gets placed in index of 16. 

Collisions

Internal Methods

Add() - adding a new key/value pair Find() - takes in a key, gets the Hash, and goes to the index location specified Contains() - accept a key, and return a bool if key exists GetHash() - accept a key as a string, conduct the hash, and then return the index of the array where the key/value should be placed

Bookmark and Review