An electronic device rearranges a sequence of numbers step by step according to a fixed rule and then stops when the final arrangement is obtained. For the input sequence 85 16 36 04 19 97 63 09, the device produces the following steps: Step I: 97 85 16 36 04 19 63 09; Step II: 97 85 63 16 36 04 19 09; Step III: 97 85 63 36 16 04 19 09; Step IV: 97 85 63 36 19 16 04 09; Step V: 97 85 63 36 19 16 09 04, and Step V is the last step. Using exactly the same rearrangement rule, what will be the last step for the input sequence 03 31 43 22 11 09?
Aptitude
Sequential Output Tracing
Difficulty: Medium
Choose an option
Answer
Correct Answer: Step V
Explanation
Introduction / Context: This question belongs to the input–output or sequential output tracing category. A device rearranges numbers in several steps following a specific pattern. You must first identify the pattern from a worked-out example and then apply it to a new input sequence to determine at which step the final arrangement is obtained. Given Data / Assumptions:
- Example input: 85 16 36 04 19 97 63 09.
- Steps for the example:
- Step I: 97 85 16 36 04 19 63 09
- Step II: 97 85 63 16 36 04 19 09
- Step III: 97 85 63 36 16 04 19 09
- Step IV: 97 85 63 36 19 16 04 09
- Step V: 97 85 63 36 19 16 09 04 (final)
- New input: 03 31 43 22 11 09.
- We must find which step is the last when the device processes the new input.
- At each step, the device places the largest remaining number from the unsorted part in the next position from the left, keeping the relative order of the other numbers unchanged.
- This is similar to selection sort in descending order where only one element is moved at each step.