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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:16:15+00:00 2026-06-04T01:16:15+00:00

I have a array of 7 sets of data which are accessed through their

  • 0

I have a array of 7 sets of data which are accessed through their indices 0-6. I need to use 6 for training and 1 for testing which need to be cycled until 7 combinations have been achieved like so.

Training – 0, 1, 2, 3, 4, 5
Testing – 6

Training – 1, 2, 3, 4, 5, 6
Testing – 0

Training – 2, 3, 4, 5, 6, 0
Testing – 1

….

Training 6, 0, 1, 2, 3, 4,
Testing – 5

The training data will be a queue of queues of ints and the testing is a queue of ints. My brain is fried I need to help desperately. I have resorted to simply hard coding them but it looks dreadful and if I want to change the amount of sets I have then it will require a rewrite.

A lot of answer using modulo!, I only used that for finding even numbers 🙂 i’m testing now if it works your all gettin upvotes

Lots of great answers!! you guys are the best! 😀

  • 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-04T01:16:17+00:00Added an answer on June 4, 2026 at 1:16 am

    Modulo is your friend here.

    for(int i = 0; i < set.Length; i++)
    {
        for(int j = 0; j < set.Length - 1; j++)
        {
            // Do something with ... set[(i+j)%set.Length];
        }
        // Test with set[(i+set.Length-1)%set.Length]
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a (dynamic) array, which in this example contains 4 sets of data
I have an array which contains sets of three similar named items; however, sometimes
I have m sets, which can be stored using array, or arraylist. There are
In the library I'm working on, we have data sets (which may be subsets
I have array of strings, String[] data and it's 10 elements has value P
I have some binary data which has a corresponding map file which identifies each
I have a process which is repeated on a set of data stored in
I have an application which is used for data analysis and I'm having a
I have a view controller class called PresidentsViewController that sets up data in a
I have a table that displays data from a single array and organizes the

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.