🔄 Shifting Arrangement
Learn single shifting Input-Output where elements shift positions step by step to reach their sorted position, with detailed examples and position-finding techniques
Shifting Arrangement
In Shifting Arrangement, instead of picking an element and placing it at a fixed end, the machine shifts elements through the sequence. The element "bubbles" through adjacent positions until it reaches its correct spot.
This is slightly harder than Fixed because elements move through the middle of the sequence.
How Shifting Works
At each step:
- The machine identifies the next element to sort (e.g., the current smallest)
- That element shifts position by position to its correct spot
- Other elements shift by one position to make room
- This continues until the full arrangement is complete
Solved Example: Ascending Shifting
Input: 24 27 83 76 12 18 61 75
The machine sorts numbers in ascending order by shifting the smallest unsorted number to its correct position:
| Step | Arrangement | What happened |
|---|---|---|
| Input | 24 27 83 76 12 18 61 75 | 12 needs to go to position 1 |
| Step 1 | 12 24 27 83 76 18 61 75 | 12 shifted from pos 5 to pos 1 |
| Step 2 | 12 18 24 27 83 76 61 75 | 18 shifted from pos 6 to pos 2 |
| Step 3 | 12 18 24 27 83 76 61 75 | 27 was already at pos 4 (minor shift) |
| Step 4 | 12 18 24 27 61 83 76 75 | 61 shifted to pos 5 |
| Step 5 | 12 18 24 27 61 75 83 76 | 75 shifted to pos 6 |
| Step 6 | 12 18 24 27 61 75 76 83 | 76 shifted to pos 7 |
Key difference from Fixed: In shifting, when the element moves, all elements between its old and new position shift by one. In fixed, the selected element is extracted and placed at the end while others maintain relative order.
Pro Content Locked
Upgrade to Pro to access this lesson and all other premium content.
₹99 charged monthly · Cancel anytime
- All Agriculture & Banking Courses
- AI Lesson Questions (100/day)
- AI Doubt Solver (50/day)
- Glows & Grows Feedback (30/day)
- AI Section Quiz (20/day)
- 22-Language Translation (100/day)
- Recall Questions (20/day)
- AI Quiz (15/day)
- AI Quiz Paper Analysis (100/day)
- AI Step-by-Step Explanations (100/day)
- Spaced Repetition Recall (FSRS)
- AI Tutor
- Immersive Text Questions
- Audio Lessons — Hindi & English
- Mock Tests & Previous Year Papers
- Summary & Mind Maps
- XP, Levels, Leaderboard & Badges
- Generate New Classrooms
- Voice AI Teacher (AgriDots Live)
- AI Revision Assistant
- Knowledge Gap Analysis
- Interactive Revision (LangGraph)
🔒 Secure via Razorpay · Cancel anytime · No hidden fees
Shifting Arrangement
In Shifting Arrangement, instead of picking an element and placing it at a fixed end, the machine shifts elements through the sequence. The element "bubbles" through adjacent positions until it reaches its correct spot.
This is slightly harder than Fixed because elements move through the middle of the sequence.
How Shifting Works
At each step:
- The machine identifies the next element to sort (e.g., the current smallest)
- That element shifts position by position to its correct spot
- Other elements shift by one position to make room
- This continues until the full arrangement is complete
Solved Example: Ascending Shifting
Input: 24 27 83 76 12 18 61 75
The machine sorts numbers in ascending order by shifting the smallest unsorted number to its correct position:
| Step | Arrangement | What happened |
|---|---|---|
| Input | 24 27 83 76 12 18 61 75 | 12 needs to go to position 1 |
| Step 1 | 12 24 27 83 76 18 61 75 | 12 shifted from pos 5 to pos 1 |
| Step 2 | 12 18 24 27 83 76 61 75 | 18 shifted from pos 6 to pos 2 |
| Step 3 | 12 18 24 27 83 76 61 75 | 27 was already at pos 4 (minor shift) |
| Step 4 | 12 18 24 27 61 83 76 75 | 61 shifted to pos 5 |
| Step 5 | 12 18 24 27 61 75 83 76 | 75 shifted to pos 6 |
| Step 6 | 12 18 24 27 61 75 76 83 | 76 shifted to pos 7 |
Key difference from Fixed: In shifting, when the element moves, all elements between its old and new position shift by one. In fixed, the selected element is extracted and placed at the end while others maintain relative order.
The result looks the same (ascending order), but the intermediate steps can differ based on where unsorted elements are in the sequence.
Descending Shifting Example
Input: 24 27 83 76 12 18 61 75
If the machine sorts in descending order by shifting the largest unsorted number to the left:
| Step | Arrangement |
|---|---|
| Input | 24 27 83 76 12 18 61 75 |
| Step 1 | 83 24 27 76 12 18 61 75 |
| Step 2 | 83 76 24 27 12 18 61 75 |
| Step 3 | 83 76 75 24 27 12 18 61 |
| Step 4 | 83 76 75 61 24 27 12 18 |
| Step 5 | 83 76 75 61 27 24 12 18 |
| Step 6 | 83 76 75 61 27 24 12 18 |
| Step 7 | 83 76 75 61 27 24 18 12 |
| Step 8 | 83 76 75 61 27 24 18 12 |
Fixed vs Shifting — How to Tell
| Feature | Fixed | Shifting |
|---|---|---|
| Where element goes | Always left end or right end | To its sorted position in the middle |
| Other elements | Keep relative order | Shift by one position |
| Step appearance | Sorted section grows from one end | Sorted section may grow from left or right |
| Number of steps | Usually same as elements | Can vary more |
Exam tip: The question will show you 3-4 steps. Compare how elements move to determine which sub-type it is. If elements always appear at the start/end, it's Fixed. If they move to a middle position, it's Shifting.
Solved Example: Word-Number Shifting
Q. Instructions:
Input: over 73 26 egal urges 56 42 49 ick act
| Step | Arrangement |
|---|---|
| Step 1 | surges over 73 26 egal 56 42 49 ick act |
| Step 2 | 38 surges over 26 egal 56 42 49 ick act |
| Step 3 | rover 38 surges 26 egal 56 42 49 ick act |
| Step 4 | 66 rover 38 surges 26 egal 42 49 ick act |
| Step 5 | kick 66 rover 38 surges 26 egal 42 49 act |
| Step 6 | 95 kick 66 rover 38 surges 26 egal 42 act |
| Step 7 | legal 95 kick 66 rover 38 surges 26 42 act |
| Step 8 | 25 legal 95 kick 66 rover 38 surges 26 act |
| Step 9 | tact 25 legal 95 kick 66 rover 38 surges 26 |
| Step 10 | 63 tact 25 legal 95 kick 66 rover 38 surges |
Step 10 is the final arrangement.
Rule: Words are arranged in reverse alphabetical order and numbers in a specific pattern, alternating word-number placement from the left.
Practice Questions
Q1. What is the position of 'pump' in Step 7 from right end?
Step 7: legal 95 kick 66 rover 38 surges 26 42 act
There is no "pump" in this sequence (it is not one of the input words). Check if the question refers to a different element. In exams, this may be a trick — if an element does not exist in the step, the answer is "None of these" or "Cannot be determined."
However, if the question paper had a typo and meant "ick" or "kick":
- Step 7: legal 95 kick 66 rover 38 surges 26 42 act
- "kick" is at position 3 from left = position 8 from right (total 10 elements)
- But if "pump" doesn't exist, answer is: The element does not exist in any step
Q2. How many words/numbers are between '15' and 'anger' in Step 6?
For the input: anger 16 ump 63 eaten 22 41 ides 39 orts
Step 6 needs to be constructed using the detected rule. This requires identifying the exact arrangement pattern and building Step 6 from scratch.
Practice: Build the complete step-by-step arrangement for this input and count elements between the two specified items in Step 6.
Speed Technique: Shortcut for Any Step
- Determine the final sorted order — sort all words and numbers by the detected rule
- For Step K — the first K elements are in their final positions, the rest maintain original relative order
- Position questions — just number the positions 1 through N in the step you constructed
This shortcut works for both Fixed and Shifting when the pattern is a simple sorting rule.
Common Mistakes
- Confusing shifting direction: Some machines shift to the left, others to the right. Always verify from the given steps
- Wrong element count: When asked "how many between X and Y", do NOT count X and Y themselves
- Miscounting from right end: Position from right end means count starting from the last element. In a 10-element step, position 1 from right = position 10 from left
- Assuming total steps: Don't assume total steps = total elements. Sometimes the last element falls in place automatically, saving one step