1 / 6

COP 3402 Systems Programming

COP 3402 Systems Programming. Dr. Ali Orooji School of EECS University of Central Florida. SEARCHING n = number of elements. Binary Search average number of comparisons =

nigel-berry
Download Presentation

COP 3402 Systems Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. COP 3402 Systems Programming Dr. Ali Orooji School of EECS University of Central Florida

  2. SRCH - SEARCHING n = number of elements Binary Search average number of comparisons = n = 1,000 ==> avg = = 10 n = 1,000,000 ==> avg = 20 Linear Searchaverage number of comparisons = n/2 n = 1,000 ==> avg = 1000 / 2 = 500 n = 1,000,000 ==> avg = 500,000

  3. SRCH - Hashing tries to do searching with only one comparison when storing when searching

  4. 425 ==> 25 100 SRCH - Hash Functions Division Method ==> remainder Mid-Square Method (key) = - - - - - - - - (key) = 75637809 key table size 2 2

  5. 425 225 ==> ==> 25 25 100 100 SRCH - Hash Collision key 1 key 2 Resolving Hash Collision Linear Probing e.g., use next available one Linear probing is an example of a general method for resolving hash collisions called rehashing or open addressing. hash same address hash 25 425 225

  6. 25 425 225 Bucket Directory (Hash Index) 225 25 425 SRCH - Chaining if new nodes are added to the beginning of the linked list “good” hash functions have very few hash collisions

More Related