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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:34:13+00:00 2026-05-23T12:34:13+00:00

I have two pair of arrays. In each pair one array contains the index

  • 0

I have two pair of arrays. In each pair one array contains the index values referring to another result array while 2nd array contains the score. These are sorted, so that for example in pair one, i can select the 3 best high scores from Array-2 and they will correspond to indexes no 3,7 and 4 respectively.

Now the idea is to combine such pairs e.g Pair-1 and Pair-2, sort them and then select 3 best values.
Like if you see the picture below, in the sorted value array in result the first two highest values correspond to index number 1&6 in array from Pair-2 while 3rd value correspond to index 3 of array from Pair-1.
enter image description here

It would be nice if you could give me some idea about how can i keep track of index numbers of respective arrays in the sorted result. I know how to sort them but really don’t know how to go about keeping track of these individual arrays.

  • 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-23T12:34:14+00:00Added an answer on May 23, 2026 at 12:34 pm

    Think in objects.

    If you create a Pair object that has index, value and source array properties you can make it Comparable on the value.

    Create Pair objects from your arrays, put them in a List then sort it.

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

Sidebar

Related Questions

I have two arrays $brands = Array (1=>a, 2=>b); $titles = Array (1=>d, 2=>e);
A PHP question about arrays. Suppose we have two arrays: [first] => Array (
I have two sorted arrays A and B, each of length n. I also
Have two actionsheet buttons and one modalviewcontroller on mainviewcontroller in application. Now for two
I have two classes (MVC view model) which inherits from one abstract base class.
I have two arrays idxListResponse & _index both of which have the same structure.
Given an array of integers ,You have to find two elements whose XOR is
I have two arrays which contain times. The first is the state of a
I have mapped Entity framework entities. Each table in SQL Server 2008 contains Timestamp
I have two arrays containing the same elements, but in different orders, and I

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.