HELP:Hasing Table

This is a discussion on HELP:Hasing Table within the C++ Programming forums, part of the General Programming Boards category; Can anyone tell me more about this...I read the lecture note...but totally no idea what's going on to this.....Hasing table ...

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    10

    Post HELP:Hasing Table

    Can anyone tell me more about this...I read the lecture note...but totally no idea what's going on to this.....Hasing table and the closed hashing.....
    this is one of the question::::
    <code>
    5351,5635,5389,5894,5012,5555,5234,5281

    (a) using the hash function H(key) = (key -5000)%9, insert these values to simulate the behaviour of a closed hash table. Draw a diagram of the hash table after all values have been inserted in the given order(use liner probing to reslove collisions)

    (b) determine the average number of probes to find a value that is in the table from (a)

    (c)determine the average number of probes to establish that a value is not in the table from part(a)

    (d)Calculate the load factor of the table.

    (e)Explain how 5821 maybe delete from the table

    </code>
    I got no idea about this question..can anyone help..thank very much
    I'm a rookie

  2. #2
    Registered User
    Join Date
    May 2002
    Posts
    66
    This sounds like I am doing your homework... Write the program to calculate the hash of the values, then see what the results are.

    Code sample:

    Code:
      int x;
      std::cin >> x;
      int hash = (x-5000)%9;
      std::cout << "hash(" << x << ")=" << hash << std::endl;
    That should help you get started. Enter each value and see what the hash is... I leave the rest of this excersize to the reader

  3. #3
    Registered User
    Join Date
    May 2002
    Posts
    10
    hehe....thx a lot man.....
    I'm a rookie

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Writing array, to file
    By zootreeves in forum C Programming
    Replies: 9
    Last Post: 09-08-2007, 06:06 PM
  2. progarm doesnt compile
    By kashifk in forum Linux Programming
    Replies: 2
    Last Post: 10-25-2003, 06:54 PM
  3. extra word printing
    By kashifk in forum C++ Programming
    Replies: 2
    Last Post: 10-25-2003, 05:03 PM
  4. inputting words from a file
    By kashifk in forum C++ Programming
    Replies: 5
    Last Post: 10-24-2003, 08:18 AM
  5. help with operator <
    By kashifk in forum C++ Programming
    Replies: 1
    Last Post: 10-21-2003, 04:49 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21