jagomart
digital resources
picture1_Science Ppt 70637 | L8 Hashtables


 170x       Filetype PPTX       File size 0.48 MB       Source: www.cs.bilkent.edu.tr


File: Science Ppt 70637 | L8 Hashtables
hashing using balanced search trees 2 3 2 3 4 red black and avl trees we implement table operations in o logn time retrieval insertion and deletion can we find ...

icon picture PPTX Filetype Power Point PPTX | Posted on 30 Aug 2022 | 3 years ago
Partial capture of text on file.
                                                              Hashing
         • Using balanced search trees (2-3, 2-3-4, red-black, 
              and AVL trees), we implement table operations in O 
              (logN) time 
                –retrieval, insertion, and deletion
         • Can we find a data structure so that we can perform 
              these table operations even faster (e.g., in O(1) 
              time)?
                –Hash Tables
         08/29/2022                                   CS202 - Fundamental Structures of Computer                                            2
                                                                       Science II
                               Hash Tables
     • In hash tables, we have 
         –An array (index ranges 0 … n – 1) and
             • Each array location is called a bucket
         –An address calculator (hash function), which maps a 
            search key into an array index between 0 … n – 1 
     08/29/2022                CS202 - Fundamental Structures of Computer      3
                                        Science II
        Hash Function -- Address Calculator
                                Hash Function
                                                              Hash Table
     08/29/2022               CS202 - Fundamental Structures of Computer      4
                                       Science II
                                   Hashing
     • A hash function tells us where to place an item in 
        array called a hash table. 
         –This method is known as hashing.
     • Hash function maps a search key into an integer 
        between 0 and n – 1.
         –We can have different hash functions.
         –Hash function depends on key type (int, string, ...)
             • E.g., h(x) = x mod n, where x is an integer
     08/29/2022                CS202 - Fundamental Structures of Computer      5
                                        Science II
                               Collisions
     • A perfect hash function maps each search key into a 
        unique location of the hash table.
        –A perfect hash function is possible if we know all search keys in 
          advance.
        –In practice (we do not know all search keys), and thus, a hash 
          function can map more than one key into the same location.
     • Collisions occur when a hash function maps more than 
        one item into the same array location.
        –We have to resolve the collisions using a certain mechanism.
     08/29/2022             CS202 - Fundamental Structures of Computer  6
                                     Science II
The words contained in this file might help you see if this file matches what you are looking for:

...Hashing using balanced search trees red black and avl we implement table operations in o logn time retrieval insertion deletion can find a data structure so that perform these even faster e g hash tables cs fundamental structures of computer science ii have an array index ranges n each location is called bucket address calculator function which maps key into between tells us where to place item this method known as integer different functions depends on type int string h x mod collisions perfect unique the possible if know all keys advance practice do not thus map more than one same occur when resolve certain mechanism...

no reviews yet
Please Login to review.