Hash Tables

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

HashMap

Implements map interface, internal storage container for keys is a Hashtable

How do hashing methods work?

Input a large piece of data and reduce it to a smaller piece (usually an integer). Input does not need to be an integer

What is the time complexity of hash table operations?

O(N)

Hashing by Folding

Partition key into several parts, and combining int values of those parts

TreeSet

Set whose container is a Red Black Tree

Hashing by Mapping

Used to convert int values or things that can be easily converted to ints (like chars)

Shifting

Using bitwise operators to shift values in order to create the hash

HashSet

data is stored in a table with an associated hash code. Has code is used as an index. Contain NO duplicates, elements kept in order.

Load Factor

in a hash table, the fraction of the table's capacity that is filled. Normally resize when this reaches .75

How does a hash table assign an index to a value?

value's hashcode is % by the length of array. Array should optimally be a prime number (more even distribution).

Open Addressing with linear probing

when a collision occurs the calculated hash index is incremented by one.


Ensembles d'études connexes

ch. 13 Medical Math, ch. 7:4 Skeletal System, ch. 7 Anatomy and Physiology

View Set

Ap Euro Semester 1 Multiple Choice

View Set

Kyle and Carman: Essentials of Pediatric Nursing

View Set

Phase II: Quiz 4 (100 Questions)

View Set

bio study question 13, 14, bonus

View Set

Astronomy Chapter 23 Process of Science

View Set