Discussion

Explanation:

The output has the numbers arranged in the order:

smallest, largest, second smallest, second largest, third smallest, third largest and so on.

In the first step, the smallest number is moved to position 1 and the other numbers retain their relative positions.

In the second step, the largest number is moved to position 2 and the other numbers retain their positions.

This continues till the desired output is obtained.

The steps for the given input are:

​​​​​​​

Hence, option (c).

» Your doubt will be displayed only after approval.


Doubts


Feedback

Help us build a Free and Comprehensive Preparation portal for various competitive exams by providing us your valuable feedback about Apti4All and how it can be improved.


© 2024 | All Rights Reserved | Apti4All