Hashing

Beschreibung

220 Mindmap am Hashing, erstellt von dadelgado01 am 06/11/2014.
dadelgado01
Mindmap von dadelgado01, aktualisiert more than 1 year ago
dadelgado01
Erstellt von dadelgado01 vor etwa 11 Jahre
7
1

Zusammenfassung der Ressource

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
                                                      Zusammenfassung anzeigen Zusammenfassung ausblenden

                                                      ähnlicher Inhalt

                                                      CompTIA A+ 220-902
                                                      Patrick Jenkins
                                                      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