tutorial04

tutorial04 - CSC2100B 2007 Spring Data Structures Tutorial 4

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
07:02 07:02   1 CSC2100B 2007 Spring Data Structures Tutorial 4 Last updated: 6 Feb, 2007
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
07:02 07:02   2 Exercise 3A Hashing Which of the  following collision  resolution schemes  are  open addressing  hashing  schemes?  (i.e, all elements are  stored in the table  itself?) Scheme Is it an  open addressing hashing   scheme?  Put a ‘√’ under either  YES or NO. YES NO Separate  Chaining Linear Probing Quadratic  Probing Double  Hashing
Background image of page 2
07:02 07:02   3 Answer 3A Hashing Which of the  following collision  resolution schemes  are  open addressing  hashing  schemes?  (i.e, all elements are  stored in the table  itself?) Scheme Is it an  open addressing hashing   scheme?  Put a ‘√’ under either  YES or NO. YES NO Separate  Chaining Linear Probing Quadratic  Probing Double  Hashing
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
07:02 07:02   4 Review Separate chaining - chain them up…
Background image of page 4
07:02 07:02   5 Review Open Addressing Hashing  
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
07:02 07:02   6 Exercise 3B Hashing Given input { 427 132 617 419 434 967 198 254 821 } and a hash function h(x) = x mod  10 , show the  resulting hash tables using: Separate chaining Linear Probing, with probing function F( i )= (i.e, h i ( x )= h( x ) +  i ) Quadratic Probing, with probing function F( i )= i 2   (i.e, h i ( x )= h( x ) +  i 2 ) Ref: 1998a3
Background image of page 6
07:02 07:02   7 Answer3B - Chaining { 427 ,   132 617 419 434 967 198 254 821 } h(x) = x mod  10 value 0 1 2 3 4 5 6 7 8 9
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/28/2010 for the course CSC CSC1110 taught by Professor Cjyuan during the Fall '06 term at CUHK.

Page1 / 27

tutorial04 - CSC2100B 2007 Spring Data Structures Tutorial 4

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online