Example 5: Alternating extremes
Last Updated On: Sun Sep 06 2026Given Data
- Input: 14, 31, 22, 8, 27.
- Step I: 8, 14, 31, 22, 27.
- Step II: 8, 31, 14, 22, 27.
Question
What number will be placed third in Step III?
Answer
14.
Solution
- Step I moves the smallest number, 8, to the first position.
- Step II moves the largest number, 31, to the second position.
- The next smallest remaining number is 14, so it moves to third position.