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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:22:14+00:00 2026-06-06T06:22:14+00:00

The problem: 1) I have buckets of fixed size, in my case 64. This

  • 0

The problem:

1) I have buckets of fixed size, in my case 64. This cannot change.
2) Values vary in size, but are never bigger than a bucket (64).
3) Access is much slower if any element is split between buckets.

Is there some algorithm that computes the optimal order of the elements in the buckets?

There are two variations here, and I’m interested in both, to enable the user of the code to choose between speed and memory usage:

A) Splitting is allowed, but should be minimized.
B) Splitting is not allowed, and padding should be minimized.

Please either post the algorithms, or a link to them, or at least their name, if they are “well known”. An Internet search did not return anything useful, probably because the answer was drowned in irrelevant results, like optimal bucket size, and partitioning data in hash-tables.

The target language is Java, but I don’t think it should make a difference.

  • 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-06T06:22:15+00:00Added an answer on June 6, 2026 at 6:22 am

    I think you could use memory allocation algorithms, like first fit, best fit, or worst fit (you could read about them here): they are only heuristic approximations of the optimal solution, but I suspect that your original problem is related to the bin-packing problem somehow and may be NP-hard to solve optimally. Try using the approximation algorithms, and split only if you can’t place your elements without it.

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

Sidebar

Related Questions

I've seen that a few instances of this problem have been raised already. However,
Problem: I have a table that prints out vertical but I would like it
Problem: I have a string that looks like this: [1=>2,3,4][5=>6,7,8][9=>10,11,12][13=>14,15][16=>17,18] Question: How can you
Problem: I have a value in a database table. This value can either contain
So, here is my little problem. Let's say I have a list of buckets
I have exactly the same problem as this SO poster; Visual Studio Crashing When
Problem I have N items of various types evenly distributed into their own buckets
I have a problem with my avatar upload. It worked once for me but
Problem: Have made a small mail program which works perfectly on my developer pc
Problem: I have two array where one produce a category and the second produce

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.