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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:11:11+00:00 2026-05-23T00:11:11+00:00

If a Hashtable is of size 8 originally and we hit the load factor

  • 0

If a Hashtable is of size 8 originally and we hit the load factor and it grows double the size. How is get still able to retrieve the original values … so say we have a hash function key(8) transforms into 12345 as the hash value which we mod by 8 and we get the index 7 … now when the hash table size grows to 16 …for key(8) we get 12345 .. if we mod it by 16 we will get a different answer! So how do i still retrieve the original key(8)

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

    This isn’t Java specific – when a hash table grows (in most implementations I know of), it has to reassess the keys of all hashed objects, and place them into their new, correct bucket based on the number of buckets now available.

    This is also why resizing a hashtable is generally considered to be an “expensive” operation (compared to many others) – because it has to visit all of the stored items within it.

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

Sidebar

Related Questions

I want to be able to create a fixed size hashmap of say 100
Are there any implementations of a static size hashtable that limits the entries to
I have a hashtable . values() method returns values in some order different from
I have a Hashtable in Java and want to iterate over all the values
I'm iterating on an hashtable, concatenating the string values: Iterator<String> it = jsonHashtableTemp.keySet().iterator(); String
I am trying to fix the size of the Hashtable with following code. Hashtable
What are running times (Big O notaton) for the common operations (get, put, size)
I have the following executing sequentially in the one thread: int size = hashTable.size();
I have tried using #include<hash_map> and #include <hash_set> and I still get the same
What is the most elegant way to copy keys and values from one hashtable

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.