Question
If the following is the sixth step of an input, what
will be the second step? Step VI: 21, 35, 48, 92, 79, 89, 52, 62, 103, 115 Directions : Study the following information carefully to answer the questions given below:A number sorting machine, when given an input of numbers, rearranges the numbers in a particular manner step by step as indicated below, till all the numbers are arranged in a particular order. Given below is an illustration of this arrangement. Input: 45, 163, 53, 19, 81, 139, 18, 48, 73, 96 Step I: 18, 45, 163, 53, 19, 81, 139, 48, 73, 96 Step II: 18, 45, 53, 19, 81, 139, 48, 73, 96, 163 Step III: 18, 19, 45, 53, 81, 139, 48, 73, 96, 163 Step IV: 18, 19, 45, 53, 81, 48, 73, 96, 139, 163 Step V: 18, 19, 45, 48, 53, 81, 73, 96, 139, 163 Step VI: 18, 19, 45, 48, 53, 73, 81, 96, 139, 163 (This is the final arrangement and VI is the last step for this input.)Solution
The following is the logic: Input to step I: The smallest no. comes to the leftmost position and the rest shift rightward. Step I to Step II: The largest no. comes to the rightmost position and the rest shift leftward. And thus we go on arranging the nos. on left and right alternately till the final arrangement is in ascending order. We canтАЩt proceed backwards.
рдЬреЛ рд╢рдмреНрдж рдкрд┐рддрд╛ рдХрд╛ рдкрд░реНрдпрд╛рдп рди рд╣реЛ рдЙрд╕реЗ рдЫрд╛рдБрдЯрд┐рдП-
рдЕрдпреЛрдЧрд╡рд╛рд╣ рд╕реНрд╡рд░реНрдЧ рдХрд╛ рдкреНрд░рдпреЛрдЧ рдХреЗрд╡рд▓-
рдХрд░реНрдо рдХреА рджреГрд╖реНрдЯрд┐ рд╕реЗ рдХреНрд░рд┐рдпрд╛ рдХреЗ рднреЗрдж рд╣реИрдВ?
рдЬрд┐рд╕рдХрд╛ рдХреЛрдИ рдирд┐рд╢реНрдЪрд┐рдд рдирд┐рд╡рд╛рд╕-рд╕реНрдерд╛рди рди рд╣реЛ '' рдХреЗ рд▓рд┐рдП рдПрдХ рд╢рдмреНрдж рд╣реЛрдЧя┐╜...
'рд╡рд┐рдЪрд╛рд░рдзрд╛рд░рд╛' рдореЗрдВ рд╕рдорд╛рд╕ рд╣реИ-
рдХрдВрдХрди рдХрд┐рдВрдХрд┐рди рдиреВрдкреБрд░ рдзреБрдирд┐ рд╕реБрдирд┐ рдХрд╣рдд рд▓рдЦрди рд╕рди рд░рд╛рдо рд╣реГрджрдп рдЧреБрдирд┐редред - рдореЗ...
'рд╕реАрддрд╛ рдирд╣реАрдВ рдкрдврд╝рддреА рд╣реИрдЗрд╕ рд╡рд╛рдХреНрдп рдореЗрдВ рд╡рд╛рдЪреНрдп рдХрд╛ рдХреМрди-рд╕рд╛ рдкреНрд░рдХрд╛рд░ рд╣реИ ?
рд╡рд┐рд╖реИрд▓рд╛ рдореЗрдВ рдкреНрд░рддреНрдпрдп рд╣реИред┬а
рд▓рдХреАрд░ рдХрд╛ рдлрд╝рдХреАрд░ ┬а ┬ардореБрд╣рд╛рд╡рд░реЗ рдХрд╛ рдЕрд░реНрде рд╣реИрдВ
рд╣рд┐рдВрджреА рд╢рдмреНрджрдХреЛрд╢ рдореЗрдВ рдЕрдВрддрд┐рдо рд╡рд░реНрдг рдХреМрди рд╕рд╛ рд╣реИ ?