Question
What will be the last step for the following input?
Input: 172, 77, 49, 91, 90, 160, 41, 83 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. The last step will be the one arranged fully in ascending order.
A person who advocates separation of the state from religious institutions is called a
In 1976, in which Part of the Indian Constitution under Article 51A were Fundamental Duties added?
Where is the first a private agricultural mandi (market) was setup in India?
Green Climate Fund’s thirty-fourth meeting of the Board will take place from Monday, 24 October to Thursday, 27 October 2022, its headquarters is in _...
Which of the following cities has been included in the top ten cities in the Sustainable Development Goals (SDG) Urban Index and Dashboard 2021-22 by NI...
In which of the following Stadiums does the Madhya Pradesh Cricket team play the majority of their home games in Ranji Trophy?
The intricate Kasuti embroidery, honoured with a Geographical Indication (GI) tag and known for reflecting the traditions and customs of women through d...
Following Rome's withdrawal, which city has been selected to host the 2027 World Athletics Championships?
Heron drones, inducted by Indian forces for enhancing their surveillance capability, are acquired from
Acid rain results when ____ is emitted into the environment.