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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:10:14+00:00 2026-06-15T17:10:14+00:00

I have SQL request that returns (x,y,z) tuples with : x between 1 and

  • 0

I have SQL request that returns (x,y,z) tuples with :

  • x between 1 and 9
  • y between 1 and 500
  • z between 1 and 15

So I have 9 * 500 * 15 = 67500 possibilities maximum and 0 possibilities minimum if all my 67500 possibilities are stored into database.

I can have (4, 256, 1) for example in my lists but not (3, 410, 8).

I want to generate 3 linked lists. For example if I choose x=2 I want the second list to display all the available y for this x value and idem for z values with y choice.

Should I use Collection ar Array to retrieve easily values to generate mys lists ?

  • 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-15T17:10:16+00:00Added an answer on June 15, 2026 at 5:10 pm

    With the keys falling in small ranges like this, a simple 2D array of shorts would be sufficient:

    short data[10][500];
    

    The first index is the value of x; the second index is the value of y.

    The values of z are stored as individual bits of the short at [x][y]. To access individual bits, use bit operations:

    if ((data[x][y] & (1 << z)) != 0) // The element at x,y,x is present
        ...
    data[x][y] != (1 << z); // Add an element at x,y,z
    data[x][y] &= ~(1 << z); // Remove the element at x,y,z
    

    This data structure is very efficient in space: it needs roughly 10KBytes of memory to store the entire data set.

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

Sidebar

Related Questions

I have the following SQL code that runs against a Change Request database. Each
I have a very complex Linq to SQL query that returns a result set
I have a piece of code that imports data into a sql table. When
I have a Profile model and two ActiveRecord::Relations of this model. SQL request of
I have sql database stored on a shared netwrok drive , after set of
I have an application that takes data via a POST request. I am using
EDIT : the function creation was missing, sorry about that I have a T-SQL
I have a WCF service that does some document conversions and returns the document
I have this function i need to do that in sql (hibernate or mysql)
I have the following controller that returns a list of tags when it receives

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.