Direction: Study the following information carefully and answer the question given below.
An algorithm rearranges a sequence of numbers following a specific rule in each step. Following is an illustration of input and the subsequent steps of rearrangement.
Input: 98 31 06 72 63 59 36 12 84
Step 1: 98 31 36 72 63 59 06 12 84
Step 2: 84 31 36 72 63 59 06 12 98
Step 3: 84 31 36 63 72 59 06 12 98
Step 4: 84 31 12 63 72 59 06 36 98
Given Input: 31 59 06 72 84 12 36 98 63
Which step will be "63 59 36 84 72 12 06 98 31"?
- AStep 1
- BStep 2
- CStep 3
- DStep 4
Solution & Step-by-step Explanation
Let's analyze the pattern in the example:
* In Step 1, the 3rd element (06) and the 7th element (36) are swapped.
* In Step 2, the 1st element (98) and the 9th element (84) are swapped.
* In Step 3, the 4th element (72) and the 5th element (63) are swapped.
* In Step 4, the 3rd element (06) and the 8th element (12) are swapped.
Now let's apply this exact same sequence of positional transformations to the new input:
Given Input: 31 59 06 72 84 12 36 98 63
Step 1: Swap 3rd (06) and 7th (36) elements:
Step 2: Swap 1st (31) and 9th (63) elements:
Step 3: Swap 4th (72) and 5th (84) elements:
The sequence we are looking for is "63 59 36 84 72 12 06 98 31", which matches Step 3 exactly.
* In Step 1, the 3rd element (06) and the 7th element (36) are swapped.
* In Step 2, the 1st element (98) and the 9th element (84) are swapped.
* In Step 3, the 4th element (72) and the 5th element (63) are swapped.
* In Step 4, the 3rd element (06) and the 8th element (12) are swapped.
Now let's apply this exact same sequence of positional transformations to the new input:
Given Input: 31 59 06 72 84 12 36 98 63
Step 1: Swap 3rd (06) and 7th (36) elements:
Step 2: Swap 1st (31) and 9th (63) elements:
Step 3: Swap 4th (72) and 5th (84) elements:
The sequence we are looking for is "63 59 36 84 72 12 06 98 31", which matches Step 3 exactly.