Hashing

Discussion in 'C++' started by snowteo, May 19, 2004.

  1. snowteo

    snowteo Guest

    Hi,I have to do this exercises can you help me:
    1)Write a program to implement exetendible hashing.If the table is small
    enough to fin in main memory,how does its performance compare with open and
    closed hasing?
    2)A basic program consists of a series of statements,each of which is
    numbered in ascending order.Control is passed by use of a goto or gosub and
    a statement number.Write a program that reads in a legal BASIC program and
    renumbers the statements so that the first starts at number f and each
    statement has a number d higher than the previous statement.You may assume
    an upper limit of n statements,but the statement numbers in the input might
    be as large as a 32-bit integer.Your program must run in linear time.
    Of it I have resolved many others,but these two I just do not succeed to
    make them.Thank you very much
     
    snowteo, May 19, 2004
    #1
    1. Advertising

  2. snowteo wrote:
    >
    > Hi,I have to do this exercises can you help me:
    > 1)Write a program to implement exetendible hashing.If the table is small
    > enough to fin in main memory,how does its performance compare with open and
    > closed hasing?
    > 2)A basic program consists of a series of statements,each of which is
    > numbered in ascending order.Control is passed by use of a goto or gosub and
    > a statement number.Write a program that reads in a legal BASIC program and
    > renumbers the statements so that the first starts at number f and each
    > statement has a number d higher than the previous statement.You may assume
    > an upper limit of n statements,but the statement numbers in the input might
    > be as large as a 32-bit integer.Your program must run in linear time.
    > Of it I have resolved many others,but these two I just do not succeed to
    > make them.Thank you very much


    Could you be more specific.
    What is your problem *exactly* ?

    For the 1) do you know what is 'extendible hashing'.
    same for 'open hashing', 'closed hashing'.

    The whole problem seems to be to know the theory behind
    these concepts. Once this theory is understood, an implementation
    should be no problem

    For 2)
    read the file and create a table with 2 columns, the first
    column holds the line number in the original 'program', the
    second column holds the modified line number (you get this
    modified line number by using the given arguments)

    Do a second pass through the program and replace the
    original line number with the modified line number. At the
    same time analyze the statement. Is it a goto or gosub, then
    take the target line number, look it up in the table and
    replace it with the modified line number.

    --
    Karl Heinz Buchegger
     
    Karl Heinz Buchegger, May 19, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guadala Harry
    Replies:
    4
    Views:
    381
    Steve C. Orr [MVP, MCSD]
    Sep 12, 2004
  2. =?Utf-8?B?QnJpYW4=?=

    Password Hashing and User Authentication

    =?Utf-8?B?QnJpYW4=?=, Jun 6, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    381
    =?Utf-8?B?QnJpYW4=?=
    Jun 6, 2005
  3. Showjumper

    Hashing Passwords

    Showjumper, Dec 21, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    387
    Showjumper
    Dec 22, 2005
  4. TT \(Tom Tempelaere\)

    Hashing

    TT \(Tom Tempelaere\), Feb 5, 2004, in forum: Java
    Replies:
    6
    Views:
    724
    TT \(Tom Tempelaere\)
    Feb 8, 2004
  5. Password hashing

    , Apr 15, 2004, in forum: Java
    Replies:
    3
    Views:
    2,381
    Roedy Green
    Apr 15, 2004
Loading...

Share This Page