hash - Extendible hashing for file with given search key values for records -


i know might wrong place answers questions such these, @ moment need answer , how work out step step urgently.

suppose using extendable hashing on file contains records following search-key values: 2, 3, 5, 7, 11, 17, 19, 23, 29, 31 show extendable hash structure file if hash function h(x) = x mod 8 , buckets can hold 3 records.

edit: have "supposed" answer this: http://i.imgur.com/cw8h8vg.png not sure if correct, since when work out, different hash structure. if correct, explain me why?

h(2) = 2 => 0, 0, 2, 0, 0, 0, 0, 0 h(3) = 3 => 0, 0, 2, 3, 0, 0, 0, 0 h(5) = 5 => 0, 0, 2, 3, 0, 5, 0, 0 h(7) = 7 => 0, 0, 2, 3, 0, 5, 0, 7 h(11) = 3 => 0, 0, 2, { 3, 11 }, 0, 5, 0, 7 h(17) = 1 => 0, 17, 2, { 3, 11 }, 0, 5, 0, 7 h(19) = 3 => 0, 17, 2, { 3, 11, 19 }, 0, 5, 0, 7 h(23) = 7 => 0, 17, 2, { 3, 11, 19 }, 0, 5, 0, { 7, 23 } h(29) = 5 => 0, 17, 2, { 3, 11, 19 }, 0, { 5, 29 }, 0, { 7, 23 } h(31) = 7 => 0, 17, 2, { 3, 11, 19 }, 0, { 5, 29 }, 0, { 7, 23, 31 } 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -