Question:

Given an input line of numbers and words, a machine rearranges them following particular rule in each step. Here is an illustration of an input and rearrangement sequence (Step 1 to Step 5) :
Input: 61 wb ob 48 45 29 34 sb pb lb
Step 1: lb wb ob 48 45 29 34 sb pb 61
Step 2: lb ob wb 45 29 34 sb pb 61 48
Step 3: lb ob pb wb 29 34 sb 61 48 45
Step 4: lb ob pb sb wb 29 61 48 45 34
Step 5: lb ob pb sb wb 61 48 45 34 29
Step 5 is the last step of the above arrangement.
Based on the rules followed in the above steps, answer the following question :
Input: cb kb eb 58 49 23 38 jb nb gb 69 82
Which of the following represents the position of 58 in the fourth step? (Step-5 is the last step of the arrangement.)

Updated On: Aug 21, 2025
  • Second from the left
  • Fourth from the right
  • Third from the right
  • Seventh from the left
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

Step 1: Start with words in alphabetical order, place the largest number at the end. 
Sequence:  
eb kb cb 58 49 23 38 jb nb gb 69 82

Step 2: Next word "gb" comes forward, and next largest number moves to the end. 
Sequence: 
eb gb kb cb 49 23 38 jb nb 82 69 58

Step 3: Next word "jb" moves, with the next largest number placed at the end. 
Sequence: 
eb gb jb kb 23 38 nb 82 69 58 49

Step 4: Word "kb" is positioned, and the remaining numbers are ordered. 
Sequence: 
eb gb jb kb nb 82 69 58 49 38 23

Final Answer:
In Step 4, the number 58 is \[ \text{third from the right} \] in the sequence.

Was this answer helpful?
1
1

Questions Asked in GATE XH-C1 exam

View More Questions