Presentation is loading. Please wait.

Presentation is loading. Please wait.

Insert using Linear Hashing h0 0 1 4 H level (n) = level+1 bits of nLevel = 0, next = 7 Insert 2, h 0 (2) = 0 initial 4 = 100, so h 0 (4) = 0 7 = 111,

Similar presentations


Presentation on theme: "Insert using Linear Hashing h0 0 1 4 H level (n) = level+1 bits of nLevel = 0, next = 7 Insert 2, h 0 (2) = 0 initial 4 = 100, so h 0 (4) = 0 7 = 111,"— Presentation transcript:

1 Insert using Linear Hashing h0 0 1 4 H level (n) = level+1 bits of nLevel = 0, next = 7 Insert 2, h 0 (2) = 0 initial 4 = 100, so h 0 (4) = 0 7 = 111, so h 0 (7) = 1

2 Insert using Linear Hashing h0 0 1 4 2 H level (n) = level+1 bits of nLevel = 0, next = 7 Insert 8, h 0 (8) = 0

3 Insert using Linear Hashing h0 0 1 4 2 H level (n) = level+1 bits of nLevel = 0, next = 78 No room, so insert into an overflow block, which triggers the splitting process.

4 Insert using Linear Hashing h0 0 1 4 2 H level (n) = level+1 bits of nLevel = 0, next = 78 No room, so insert into an overflow block, which triggers the splitting process. H 1 (4) = 00 H 1 (2) = 10 H 1 (8) = 00 h1 00 01 10 11

5 Insert using Linear Hashing h0 0 1 4 8 H level (n) = level+1 bits of nLevel = 0, next = 7 h1 00 10 2 Denotes split bucket No room, so insert into an overflow block, which triggers the splitting process. H 1 (4) = 00 H 1 (2) = 10 H 1 (8) = 00

6 Insert using Linear Hashing h0 0 1 4 8 H level (n) = level+1 bits of nLevel = 0, next = 7 Insert 5, h 0 (5) = 1 Advance NEXT by one. h1 00 10 2

7 Insert using Linear Hashing h0 0 1 4 8 H level (n) = level+1 bits of nLevel = 0, next = 7 5 Insert 3, h 0 (3) = 1 h1 00 10 2

8 Insert using Linear Hashing h0 0 1 4 8 H level (n) = level+1 bits of nLevel = 0, next = 7 5 No room, insert into overflow and trigger a split. h1 00 10 23

9 Insert using Linear Hashing h0 0 1 4 8 H level (n) = level+1 bits of nLevel = 0, next = 5 Redistribute 3, 5, 7 using H 1 H 1 (3) = 11 H 1 (5) = 01 H 1 (7) = 11 h1 00 01 10 11 23 7

10 Insert using Linear Hashing h0 0 1 4 8 H level (n) = level+1 bits of nLevel = 0, next = 5 Advance Next, but it is at the bottom of the current Level. h1 00 01 10 11 23 7

11 Insert using Linear Hashing h0 0 1 4 8 H level (n) = level+1 bits of nLevel = 1, next = 5 So reset it to the top and increment Level to 1. h1 00 01 10 11 23 7

12 Insert using Linear Hashing 4 8 H level (n) = level+1 bits of nLevel = 1, next = 5 Remove split indicators and only use H 1 h1 00 01 10 11 23 7

13 Insert using Linear Hashing 4 8 H level (n) = level+1 bits of nLevel = 1, next = 5 Insert 15, h 1 (15) = 11 h1 00 01 10 11 23 7

14 Insert using Linear Hashing 4 8 H level (n) = level+1 bits of nLevel = 1, next = 5 h1 00 01 10 11 23 715 No room, so insert into an overflow block, which triggers the splitting process.

15 Insert using Linear Hashing 4 8 H level (n) = level+1 bits of nLevel = 1, next = 5 h1 00 01 10 11 23 715 Split Next using level+1 H function H 2 (4) = 100 H 2 (8) = 000

16 Insert using Linear Hashing 8 H level (n) = level+1 bits of nLevel = 1, next = 5 h1 00 01 10 11 23 715 Split Next using level+1 H function H 2 (4) = 100 H 2 (8) = 000 h2 100 4 h2 000

17 Insert using Linear Hashing 8 H level (n) = level+1 bits of nLevel = 1, next = 5 h1 00 01 10 11 23 715 Mark bucket as split Advance Next. h2 100 4

18 Insert using Linear Hashing 8 H level (n) = level+1 bits of nLevel = 1, next = 5 h1 00 01 10 11 23 715 Mark bucket as split Advance Next. h2 100 4 And Insert and Insert and Insert ….


Download ppt "Insert using Linear Hashing h0 0 1 4 H level (n) = level+1 bits of nLevel = 0, next = 7 Insert 2, h 0 (2) = 0 initial 4 = 100, so h 0 (4) = 0 7 = 111,"

Similar presentations


Ads by Google