Prove that the first list contains numbers from k to 2k and second list contains numbers from 1 to k.
There are two lists that contain integers from 1 to 2k such that the first list contains k randomly chosen integers from the range 1 - 2k and the second list contains the remaining numbers.
For Example: and when .
Now arrange the first list such that it is in ascending order and the second list such that it is in descending order.Same Example: and .
Now check the elements in the same position in both lists and make a swap such that the first list contains the greater number while the second list contains the smaller number.
Same Example: and .
Prove that the first list contains numbers from k to 2k and second list contains numbers from 1 to k.
It will be really helpful if I can get some directions on how to do this question because a similar question of sort was asked but I don't think that the answer to that question was similar.
I have tried it several times and looked for any similar problem but couldn't find them. I know this might be very obvious but please help me out and If there is a similar problem with the solution I would be interested about reading up on it. Thanks.