• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help to code small programme  RSS feed

Zeeshan Paracha
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good Evening Sir,

Sir for this assignment we have to use hashing technique called (Digit Extraction). we have to store data in an array according to the key created by using (Digit Extraction) hashing method. The collision will occur if the multiple data is been stored in a same index to over come with collision we have to implement (Pseudorandom) Collision method to generate new key and stored the data or that new key/index of array.

formula for Pseudorandom Collision Resolution is (ax + c) = new address .. where (a) and (c) is the constant.
and digit extraction is just extract the key(address) from the data for eg;
if user wanna save data (Student ID = 110011) out of this 6-digit ID we can get any 3 digit like (011).

Below are the requirements.

Choose one hashing technique and one hashing resolution technique to demonstrate hashing technique. You are required to use array of objects with minimum two data field for eg (ID and Name). Your program should include the following options:-

1. Add a new record.
2. Search for a record.
3. List all the records. < together with the location where it is stored>

This program should be written in Java Language, Plat form (Jdk) or Blue J software.

Paul Clapham
Posts: 22844
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, Zeeshan, welcome to the Ranch! That's an excellent description of your requirements... but it isn't a question. Could I ask you to read through some of our FAQ links here: HowToAskQuestionsOnJavaRanch, so you have a better idea of how to ask a good question? I particularly recommend NotACodeMill and ShowSomeEffort and DoYourOwnHomework.
Winston Gutkowski
Posts: 10575
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Zeeshan Paracha wrote:Good Evening Sir,...

Very polite, but there's no need to call me sir (unless the Queen's around).

As to your problem (and I agree with Paul: very well described), my advice to you is this:
  • (VERY IMPORTANT) Turn off your computer.
  • Forget about Java for the moment, and write out what you think:
    (a) the problem is.
    (b) the steps to solving it (and be specific).
    And write it in English (or your native language).
  • Test your theory on paper. (NOTE: this may take time, patience, and lots of paper.)

  • When you think you have a solution:

  • Turn your computer back on.
  • Start writing a program that follows the steps you've come up with.

  • At any point in this process, feel free to come back with questions or problems; but make sure to show us what you've already done.

    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!