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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:40:44+00:00 2026-05-24T13:40:44+00:00

I have a 2D array that holds unique integers – this represents a physical

  • 0

I have a 2D array that holds unique integers – this represents a physical container with rows/columns – in each position there is a vial.

I know the integers that should be in the array and where they should be located.

My array however is shuffled with potentially many/all unique integers in the wrong positions.

I now need to sort the array – however this maps to a physical process and therefore I really want to reduce the number of sort steps involved due to potential human error.

Is this just a plain sort? or is there a more specific name for this scenario? Is there well known solutions?

My colleague has suggested just creating a list of swap [1][1] with [2][1] type instructions, which seems reasonable however I can’t quite get my head around if the order of swaps is important.

All assistance grateful.

  • 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-24T13:40:45+00:00Added an answer on May 24, 2026 at 1:40 pm

    If you really can tell, just by looking at the vial, where it belongs, the shortest way is to take the first vial that is in the wrong place out, then put it where it belongs, take whatever was there, put it to its proper place, etc., until you happen to get the vial that belongs where you originally made a “hole”. Then repeat.

    Since you take out each vial at most once, and only if it is in the wrong place, I think that this is optimal with respect to physical motion.

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

Sidebar

Related Questions

I have an int array that holds a single digit in each index so
I have a array that looks like this Array ( [provider] => Array (
I have an array that contains the RGB colour values for each pixel in
I have an array that looks like this: Array ( [0] => Array (
So I have an array that holds several numbers. As my script runs, more
I have an array that holds numbers: int tarningar[] = new int[5]; When all
Ok so I have an array that holds the following elements: $array['a']['b'][0]['c']; $array['a']['b'][1]['c']; $array['a']['d'][0]['c']['c'];
I have NSMutable array that holds data captured from external sensor through iphone. I
If I have an array that holds various days of the week (i.e. @Fri,
HI i'm stock with generating a random number I have an array that holds

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.