CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon


Question

Which of the following will be the third step for the following input?

Input: 31 78 97 132 28 12 175 54 99 112



A

12 28 31 78 97 175 54 99 112 132

loader
B

12 28 31 97 78 54 99 112 132 175

loader
C

12 28 31 78 97 132 54 99 112 175

loader
D

12 28 31 97 78 132 99 54 112 175

loader

Solution

The correct option is D

12 28 31 78 97 132 54 99 112 175


Here the rule followed is:

Step I: The smallest number becomes first and the remaining numbers shift one position rightward. In case, the first number is small then the next number just larger than it will become second and the rest will shift one position rightward and so on.

Step II: The largest number among given numbers becomes last and the remaining numbers shift one position leftward. In case, the largest number is first from the right end, the second largest number replaces the second number from the right end, and so on.

These steps are repeated alternately till all the numbers get arranged in ascending order and that will be the last step for that particular input.


Logical Reasoning

Suggest Corrections
thumbs-up
 
0


similar_icon
Similar questions
View More



footer-image