Hashing

Description

220 Mind Map on Hashing, created by dadelgado01 on 06/11/2014.
dadelgado01
Mind Map by dadelgado01, updated more than 1 year ago
dadelgado01
Created by dadelgado01 over 10 years ago
5
1
1 2 3 4 5 (0)

Resource summary

Hashing
  1. Data Structures
    1. Associative Array or Dictionary
    2. O(1) to find any record
      1. Hash Functions
        1. Should produce hash codes that are (almost) uniformly random
          1. Hashing methods
            1. Division
              1. Use prime number as table size, m
                1. Convert keys, k, into integers
                  1. use remainder, h(k) = k % m as hash value
                  2. Folding
                    1. Divide the int key, k, into sections
                      1. Add, subtract and/or multiply them, combining them into the hash code
                      2. Middle-Squaring
                        1. Choose a middle section of the int key, k
                          1. Square the chosen section
                            1. Use middle section of hat result as hash key
                            2. Truncation
                              1. Delete part of the key, k
                                1. Use remaining part as hash key
                            3. Hash Collisions
                              1. The Perfect Hash Function is one that gives a different hash code for every key
                                1. A Minimal hash function is when the number of keys n equals the array size m
                                  1. Collision Resolution Policy
                                    1. OALP - Open Addressing with Linear Probing
                                      1. Successive search for first entry with matching key at lower location in table
                                        1. If no such entry, "Wrap around" the table
                                          1. Clusters keys together
                                          2. OADH - OA with Double Hashing
                                            1. Hash a collided key again with a different hash function
                                              1. Use result of second hashing as increment for probing table locations
                                              2. Other Techniques
                                                1. Hash Buckets
                                                  1. Divide a big hash table into several small sub-tables, or buckets
                                                    1. Hash function maps key into one of the buckets
                                                      1. Keys are stored in each bucket in sequentially increasing order
                                                    2. Chaining
                                                      1. All records for a single hash address are kept in a linked list, or chain, started at that address
                                                2. Desired Properties for a good Hashing theme
                                                  1. Hash locations spread out
                                                    1. Use relatively small table size, that doesn't affect performance
                                                      1. The function h is fast to compute
                                                      Show full summary Hide full summary

                                                      0 comments

                                                      There are no comments, be the first and leave one below:

                                                      Similar

                                                      Chp 11.
                                                      Omo Mora
                                                      Chp 13 and 16
                                                      Omo Mora
                                                      Macroecon Exam 1
                                                      Omo Mora
                                                      Chapter 10
                                                      Omo Mora
                                                      Hash Functions
                                                      msladey
                                                      Static Perfect Hashing
                                                      msladey
                                                      Cuckoo Hashing
                                                      msladey
                                                      Plate Tectonics
                                                      eimearkelly3
                                                      Bayonet Charge flashcards
                                                      katiehumphrey
                                                      How Parliament Makes Laws
                                                      harryloftus505