Question
Which of the following will be the last step for the
following input? Input: 35 50 80 95 75 45 65 85 25 60 Directions : Study the following information to answer the given questions: 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. Input: 17 56 32 70 81 25 77 92 52 23 60 97 Step I: 17 23 32 70 81 25 77 92 52 56 60 97 Step II: 17 23 32 70 81 25 77 60 52 56 92 97 Step III: 17 23 25 70 81 32 77 60 52 56 92 97 Step IV: 17 23 25 70 56 32 77 60 52 81 92 97 Step V: 17 23 25 32 56 70 77 60 52 81 92 97 Step VI: 17 23 25 32 56 70 52 60 77 81 92 97 Step VII: 17 23 25 32 52 70 56 60 77 81 92 97 Step VIII: 17 23 25 32 52 60 56 70 77 81 92 97 Step IX: 17 23 25 32 52 56 60 70 77 81 92 97 and step IX is the last step for the given input.Solution
Here the rule followed is: Step I: The smallest number interchanges its position with the first number. [In case the first number is smallest then the next number just larger than it interchanges its position with the second number.] Step II: The largest number interchanges its position with the last number. [In case the largest number is first from right end, the second largest number interchanges its position with the second number from right and so on.] These steps are repeated alternately till the numbers get arranged in ascending order and that will be the last step for the particular input. Because all the numbers in this step are arranged in ascending order.
- Anu can finish 25% of an assignment in 10 days, whereas Tanya can do 30% in 12 days. Anu works on it for 16 days and leaves. How long will Tanya take to... 
- X can do a piece of work in 36 days. He worked at it for 6 days and then Y finished it in 20 days. In how many days can X and Y together finish the work... 
- A can do a piece of work in 28 days, while B can do the same piece of work in 42 days. They begin working together and 6 days before completion of work,... 
- A can complete `1/4` of a work in 6 days and B can complete `2/5` of the work in 12 days. In how many days can both A and B together complete the work?<... 
- 24 delivery boys can complete a delivery in 15 days. If 12 boys start the same work, and after 12 days, 'd' more boys join the work, completing the rema... 
- Priya completes 30% of a task in 9 days. Her efficiency is 50% greater than Meera's. How many days will it take for both Priya and Meera, working together,...
- 10 girls can finish a task in 8 days, while 5 women can finish the same task in 4 days. In how many days will 4 girls and 1 woman together finish the task? 
- 'B' is 37.5% more productive than 'A'. Together, they can finish a task in 40 days. How many days would it take for 'A' alone to complete the entire task? 
- I and J together complete a piece of work in 20 days. If I alone can do it in 50 days, how many days will J alone take? 
- Q can do a work in 15 days and R can do the two-third work done by P and Q together in a day. If R completes the work in 18 days, how many days will it ...