Question: 4. Given two sorted halves below, count number of inversions where a i and a j are in different halves. Combine two sorted halves into
4. Given two sorted halves below, count number of inversions where ai and aj are in different halves. Combine two sorted halves into sorted whole. Show your steps on the numbers (Your pointers). Write inversions in each step and total number of inversions in the designated Total box.
| 4 | 7 | 11 | 12 | 19 |
| 3 | 5 | 8 | 9 | 13 |
|
|
|
|
|
|
|
|
|
|
|
Auxiliary array
Total:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
