design of hashing algorithms

Upload: lucky-yoh

Post on 05-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 Design of Hashing Algorithms

    1/17

  • 7/31/2019 Design of Hashing Algorithms

    2/17

  • 7/31/2019 Design of Hashing Algorithms

    3/17

  • 7/31/2019 Design of Hashing Algorithms

    4/17

  • 7/31/2019 Design of Hashing Algorithms

    5/17

  • 7/31/2019 Design of Hashing Algorithms

    6/17

  • 7/31/2019 Design of Hashing Algorithms

    7/17

  • 7/31/2019 Design of Hashing Algorithms

    8/17

  • 7/31/2019 Design of Hashing Algorithms

    9/17

  • 7/31/2019 Design of Hashing Algorithms

    10/17

  • 7/31/2019 Design of Hashing Algorithms

    11/17

  • 7/31/2019 Design of Hashing Algorithms

    12/17

  • 7/31/2019 Design of Hashing Algorithms

    13/17

  • 7/31/2019 Design of Hashing Algorithms

    14/17

  • 7/31/2019 Design of Hashing Algorithms

    15/17

    10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 260

    100

    200

    300

    400

    500

    Figure 1. Time expense of random lookups on the ALPHA. The X-axis is the logarithm of

    table space in bytes. The Y-axis is the average time in nanoseconds to perform a lookup.

    1-byte integer

    2-byte integer

    4-byte integer

    0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9

    400

    500

    600

    700

    800

    900

    1000

    1100

    1200

    Figure 2. Time expense of insertions on the ALPHA. The X-axis is the load factor.

    The Y-axis is the average time in nanoseconds to insert a key. Insertions start with

    an empty table and end at the load factor on the X-axis. The table has 4M key slots.

    chaining 2

    double hashing

    chaining 1

    packed chaining

    packed double hashing

    liner probing

  • 7/31/2019 Design of Hashing Algorithms

    16/17

    16 17 18 19 20

    0

    100

    200

    300

    400

    500

    600

    700

    Figure 3. Time expense of insertions on the ALPHA. The X-axis is the logarithm

    of key set size. The Y-axis is the average time in nano-seconds to insert a key.

    Insertions start with an empty table and end with a load factor of 0.2 for chaining

    and double hashing and 0.5 for linear probing, packed chaining and packed double hasing.

    chaining

    double hashing

    packed chaining

    packed double hashing

    linear probing

    0.2 0.3 0.4 0.5 0.6 0.7 0.8

    0.0

    0.5

    1.0

    1.5

    2.0

    2.5

    3.0

    3.5

    4.0

    4.5

    5.0

    5.5

    Figure 4. Average number of probes and jumps per insertion using closed

    hashing. The X-axis is the load factor. The table has 4M key slots.

    packed double hashing (probe)

    linear probing (probe)

    double hashing (probe and jump)

    linear probing (jump)

    packed double hashing (jump)

  • 7/31/2019 Design of Hashing Algorithms

    17/17

    0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9

    0.0

    0.5

    1.0

    1.5

    2.0

    2.5

    Figure 5. Average number of probes and jumps per insertion using

    chaining. The X-axis is the load factor. The table has 4M key slots.

    packed chaining (probe)

    chaining (probe and jump)

    packed chaining (jump)

    0.2 0.3 0.4 0.5 0.6 0.7 0.8

    0.0

    0.5

    1.0

    1.5

    2.0

    2.5

    Figure 6. Average number of cache misses per insertion.

    The X-axis is the load factor. The table has 4M key slots.

    double hashing

    linear probing

    packed double hashing

    chaining

    packed chaining