Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6742413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:50:25+00:00 2026-05-26T11:50:25+00:00

I am writing a program that will hash words from a document along with

  • 0

I am writing a program that will hash words from a document along with their frequency of use and line numbers. I thought that I had finished it when I was told that you have to create a hash table from scratch. I do not know where to begin. Any suggestions as to where and how to start would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:50:26+00:00Added an answer on May 26, 2026 at 11:50 am

    A hash table is an important and fundamental data structure. You can read more about it at Wikipedia’s Hash table article. Fortunately, they are fairly easy to implement.

    Basically a hash table is a data structure that takes a key and returns or stores a value for that key.

    At their core, they are usually implemented using an array, which we shall call arr such that key-value pairs are stored at arr[key.hashCode()%arr.length]. Notice that since your array is not of infinite length, and that hashCode is not guaranteed to produce unique values you will eventually end up with keys that map to the same index of the array. This is called a collision.

    One way of resolving these collisions is to store a linked list for each member of arr. Then the definition of arr would look like this

    LinkedList<Object> arr[];
    

    All objects which map to arr[key.hashCode()%arr.length] will be added to the list at that position. When you want to retrieve an object from the hashtable, jump to the linked list found at arr[key.hashCode()%arr.length] and iterate through each member of the linked list until you find a key-value pair where the keys are .equals.

    A good hash table implementation might do things like resize arr once it gets too full.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a program that will draw a solid along the curve of
If you are writing a program that is executable from the command line, you
I am writing a program that will change java code. It changes the next-line
I am writing a program that will parse and manipulate logs from Darwin Streaming
I'm writing MIPS program that will examine a list of 10 numbers to be
I am writing a program that will call a function from an external library,
I'm writing a Perl program that will take a few command-line arguments (they'll actually
I am writing a program that will read lines from an infile using getline
I am writing a program that will access several hundred words frequently, so instead
I've been writing a C++ program that will eventually remove certain undesired formatting from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.