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.
- A rectangle has its sides measuring 32 cm in length and 18 cm in breadth. If the length is increased by 50% and the breadth is reduced by 20%, calculate th...
The perimeter of a floor a room is 36m. What is the area of four walls of the room, if its height is 6m?
The sum of the total surface areas of two cubes is 1572 cm2. If the product of the length of their edges is 99 cm2, then find the ...
- A shopkeeper plans to wrap a rectangular gift box with gift paper. The dimensions of the box are 15 cm × 12 cm × ‘a’ cm. The cost of wrapping the gif...
Perimeter of a square is equal to perimeter of a rectangle, if area of square is 900 sq.cm and length of rectangle is four times that of breath. Find th...
The volume of a cube is 4096 cm³. If the cost of painting the cube is Rs. 4 per cm², then find the cost of painting five faces of the cube.
- The volume of a cube is 343 cm³. If the cost of painting the cube is Rs. 9 per cm², then find the cost of painting five faces of the cube.
The two parallel sides of a trapezium are 27 cm and 13 cm respectively. If the height of the trapezium is 8 cm, then what is its area in m²?
The ratio of the height of cylinder and cone is 14:27, and ratio of the radius is 6:7. The cylinder and cone are transformed into two cubes, respectivel...
The length and breadth of a rectangular plot of a land are in the ratio 9:7. The owner spent Rs 8,000/- for surrounding it from all the sides at ...