Hash Tables: Handling Collisions .edu
CSE 373: Data Structures and Algorithms
Hash Tables: Handling Collisions
Autumn 2018
Shrirang (Shri) Mare
shri@cs.washington.edu
Thanks to Kasey Champion, Ben Jones, Adam Blank, Michael Lee, Evan McCarty, Robbie Weber, Whitaker
Brand, Zora Fung, Stuart Reges, Justin Hsia, Ruth Anderson, and many others for sample slides and materials ...
Announcements
- HW3 due Friday Noon
- Office hours for next week have changed. Please see the calendar for the correct info
- We made a mistake in a comment in HW4. We¡¯ll push a commit to your repo to correct
that. (So expect one more git commit from us.)
CSE 373 AU 18 ¨C SHRI MARE
2
Today
- Review Hashing
- Separate Chaining
- Open addressing with linear probing
- Open addressing with quadratic probing
CSE 373 AU 18 ¨C SHRI MARE
3
Problem (Motivation for hashing)
How can we implement a dictionary such that dictionary operations are efficient?
Idea 1: Create a giant array and use keys as indices.
(This approach is called direct-access table or direct-access map)
Two main problems:
1. Can only work with integer keys?
2. Too much wasted space
Idea 2: What if we
(a) convert any type of key into a non-negative integer key
(b) map the entire key space into a small set of keys (so we can use just the right size array)
CSE 373 AU 18 ¨C SHRI MARE
4
Solution to problem 1: Can only work with integer keys?
Idea: Use functions that convert a non-integer key into a non-negative integer key
CSE 373 AU 18 ¨C SHRI MARE
5
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- ppyytthhoonn mmoocckk tteesstt iiii
- 1 class diagrams and entity relationship diagrams erd 2
- nested data structures stanford university
- create a list of keys values key value tuples from a
- hash tables handling collisions edu
- cs bridge lecture 16 dictionaries
- data structures dictionaries
- keyboard shortcuts
- tuples and dictionaries
Related searches
- file hash for java jre downloads
- powershell hash foreach
- powershell iterate hash table
- inelastic collisions physics
- powershell working with hash tables
- powershell array of hash tables
- powershell create a hash table
- powershell convert hash to array
- nested hash tables powershell
- hash tables in powershell
- powershell loop hash table
- powershell hash getenumerator