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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:14:53+00:00 2026-05-22T19:14:53+00:00

Suppose we have two arrays: a = [4,3,8,7] b = [(1,2),(5,6),(8,6),(9,0)] So what we

  • 0

Suppose we have two arrays:

a = [4,3,8,7]
b = [(1,2),(5,6),(8,6),(9,0)] 

So what we want now is, a sorting of the array a.
So the result of the sorting should be a_sorted = [3,4,7,8] .
And, we must not sort the array b.
Instead, the order of array b must be changed according to the sorting order of array a.

So, array b must be b_sorted = [(5,6),(1,2),(9,0),(8,6)]

i.e., the order of a_sorted will be a_sorted = [a[1],a[0],a[3],a[2]].
Correspondingly, b_sorted = [b[1],b[0],b[3],b[2]]

The question is simpler. Is there a name for this kind of sorting? :

  • 1 1 Answer
  • 3 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-22T19:14:54+00:00Added an answer on May 22, 2026 at 7:14 pm

    Actually, this kind of thing isn’t really uncommon, although it’s less prevalent today than it was in the past. It’s an extension of the tag sort idea, where keys are sorted and then the corresponding records are read and written in order. You’d normally use a tag sort when:

    • There isn’t enough memory to load all of the records you want to sort, but you can easily load the keys.

    OR

    • Moving large records around in memory during the sort is very expensive. Swapping the keys takes less time.

    The second one isn’t really an issue very often these days, because you’re usually sorting an array of references, meaning that the only things that get swapped around are pointers–4 bytes or 8 bytes each.

    Some APIs have built-in support for this type of parallel array sorting. For example, the .NET Array class has a Sort(array, array) method that works exactly like you describe.

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

Sidebar

Related Questions

Suppose I have two arrays like the following: $arr2 = array(array(first, second), array(third, fourth));
Suppose I have two arrays: val ar1 = Array[String](1, 2, 3) val ar2 =
Suppose I have two arrays: $a1 = array(0, 1, 2); $a2 = array(3, 4,
Suppose I have two h:inputText components. I want to bind both of the text
Suppose I have two arrays: arrayOne = [[james, 35], [michael, 28], [steven, 23], [jack,
I have following two arrays a= [1,2,3,4] b= [1,2] c= [1,2,3,4,5] I want a
Suppose I want to have two variables and have them both equal to null
Suppose I have two arrays: a = [1, 2, 3, 4] b = [5,
Supposed that I have two arrays: Dim RoomName() As String = {(RoomA), (RoomB), (RoomC),
Suppose I have two tables, - emp(empId number(1),empName varchar2(50)) and - manager(manId number(5),managerName varchar2(100))

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.