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

The Archive Base Latest Questions

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

For class I need to make a dynamically expanding hash table that expands when

  • 0

For class I need to make a dynamically expanding hash table that expands when the number of bindings reaches certain values – 509,1021, 2039, 4093, etc. I understand just about everything else but I’m not sure how to check which value the table should expand to next.

I think that we’re supposed to use enumerations, but I don’t understand how to get the “next” enumeration value. I.e., if my hash table currently has 1022 bindings I should expand the underlying array to size 2039, but how do I know how to do that? Or am I approaching this the wrong way?

Sorry in advance if this is a stupid question, but it’s not addressed in my book and I’m still very new when it comes to C.

  • 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:29:59+00:00Added an answer on May 26, 2026 at 11:29 am

    You can’t use enumerations for this purpose in C.

    You probably want to put the thresholds in a constant array, and maintain an index to point at the current threshold:

    const int thresholds[] = { 509, 1021, 2039, 4093 };
    
    int i_thresh = 0;
    
    ...
    
    if (num_elements > thresholds[i_thresh])
    {
        i_thresh++;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have method in a class that I need to make sure is only
I need to make a 2D convex hull function for a class assignment and
All I need is a way to make a property of one class only
I need a class that works like this: >>> a=Foo() >>> b=Foo() >>> c=Foo()
I have a class that I need to binary serialize. The class contains one
I have a class that I need to perform some actions on but I
I have links that load dynamically onto a background to make them look like
I need to insert an applet into a table-row and get that table-row's height
I've inherited a website developed using Struts 1.2 that I need to make some
I'm using the hash to load content dynamically. To make the back button work

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.