Question: C++ code I have one bulk array that is [2, 5000] that is rankings from 1-5000 in first column and second column is the page

C++ code

I have one bulk array that is [2, 5000] that is rankings from 1-5000 in first column and second column is the page numbers for each rank

I sorted the values in the first column using quicksort

the second column isn't sorted they just rearrange their location and follow their designated rankings

I have 6 other arrays also [2, 5000] not sorted. that follow the same idea

I need to then sort/rearrange the second column (page numbers) of each source on how the bulk array is sorted

for example

Bulk Array

672 3487
1292 203
2738 1392
3674 3984
4932 273

Sources

1622 3487
783 203
4032 1392
394 3984
1722 273

After the sources are sorted the same as the bulk array in the second column

you then need to find the number of inversion it takes the sources the sort in their normal order

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!