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 8841907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:50:01+00:00 2026-06-14T10:50:01+00:00

I am attempting to write a Java program that uses hashing for the following

  • 0

I am attempting to write a Java program that uses hashing for the following problem. Given a natural-language text, generate a list of distinct words with the number of occurrences of each word in the text. Insert appropriate counters in the program to compare the empirical efficiency of hashing with the corresponding theoretical results.

I understand the basic principle of hashing and hash tables, but I do not know how to implement it into a computer program. My textbook gives no examples, and my professor never went over any specific examples in my class.

I believe the program should first scan the text from a file, but I have no clue where to go after that.

Thank you for the help.

  • 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-06-14T10:50:02+00:00Added an answer on June 14, 2026 at 10:50 am

    It sounds like you just need to research hashing. Hashing in general takes a range of values and maps them into some smaller range. So a simple hash function might be:

     public int hash(int value)
     {
       assert value >= 0 && value < 1000;
       return value % 10;
     }
    

    So my hash function takes number from the range (0 to 999) and maps them to (0 to 9). A good hashing function will distribute values evenly into the resulting range.

    Your goal will be to map each word to some index into your hash table, which will not be as straight-forward as my example. You will have to do some research on hashing strings.

    Good luck!

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

Sidebar

Related Questions

I'm attempting to write a program that will generate a text file with every
I am attempting to write some Java code that takes an image from a
I am attempting to write a java application that will unzip an archive and
I am curretnly attempting to write a script in python that allows me to
I am attempting to write a method that has an optional EventHandler Paramater. it
I'm attempting to write a shader to put a border around text. It compiles
I have been attempting to write a VBA Script that can parse out other
I am attempting to write a time management tool with wxPython that is ideally
I am attempting to write a file using java.io, where I am trying to
I'm attempting to write a macro which will call java setter methods based on

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.