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

  • Home
  • SEARCH
  • 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 3337288
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:14:08+00:00 2026-05-18T00:14:08+00:00

The hash value for key is caculated and is divided by a prime number.

  • 0

The hash value for key is caculated and is divided by a prime number.
In general, Is there any standard prime number (say for 32/64 bit) for this?

My understanding is the hashtable is not resizable/adjustable and its internal array depends on this. If I have a hashtable for only 5 elements will there be waste in key space?

Edit: I should have framed this better. What is general approach followed in c++ hash_map (boost) or C# Dictionary

  • 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-18T00:14:08+00:00Added an answer on May 18, 2026 at 12:14 am

    In fact, hash tables sizes can be adjustable automatically. What you might do is allocate an array of size N, using a hash modulo N (some prime number) for indexing into the array. If you keep track of the density of your allocation, then when it increases beyond some threshold you can allocate a new array of size N1 (some larger prime number), and copy over each element from the old array, applying the hash function with the new modulo to find its place in the new hash table. Finally you deallocate the old array and use the new, larger array.

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

Sidebar

Related Questions

This part of could should return always the same hash value to each Key
Ruby 1.9 has a few new syntax elements, such as the {key: value} hash
Is there a way to grab the URL's hash value (e.g. the 35 in
I know there's a function to obtain the hash value from a varchar in
Is there a hash function that returns a 16-digit hex value (as MD5 returns
Possible Duplicate: Sorting a hash in Ruby by its value first then its key.
I have an array, each of whose elements is a hash with three key/value
On google appengine, you can retrieve the hash key value by doing a query
How can i split the following string into Key-Value Pair / Hash table ...
Is there a canonical (pure-)perl implementation of a tree-based ordered key-value storage with O(log(n))

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.