First Pass: (5 1 4 2 8 ) –> (1 5 4 2 8 ), Here, algorithm compares the first two elements, and swaps since 5 > 1. ( 15 4 2 8 ) –> ( 14 5 2 8 ), Swap since 5 > 4 ( 1 45 2 8 ) –> ( 1 42 5 8 ), Swap since 5 > 2 ( 1 4 25 8 ) –> ( 1 4 25 8 ), Now, since these elements are already in order (8 > 5), algorithm does not swap them. Second Pass: (1 4 2 5 8 ) –> (1 4 2 5 8 ) ( 14 2 5 8 ) –> ( 12 4 5 8 ), Swap since 4 > 2 ( 1 24 5 8 ) –> ( 1 24 5 8 ) ( 1 2 45 8 ) –> ( 1 2 45 8 ) Now, the array is already sorted, but our algorithm does not know if it is completed. The algorithm needs onewhole pass withoutany swap to know it is sorted. Third Pass: (1 2 4 5 8 ) –> (1 2 4 5 8 ) ( 12 4 5 8 ) –> ( 12 4 5 8 ) ( 1 24 5 8 ) –> ( 1 24 5 8 ) ( 1 2 45 8 ) –> ( 1 2 45 8 )
Who sits second to the right of the one who order from Amazon?
Duck : Waddle : : Owl : ?
Which of the following is not an example of protocol?
The ratio of zinc and copper in a brass pieces is 2:5. How much zinc will be there in 140 kg of such a piece?
If K and M interchanged their positions then how many seats are there between M and R?
Which of the following is true with respect to U as per the given information?
एक लड़के की ओर इशारा करते हुए पंकज ने कहा : वह मेरी माँ के पति ...
Six persons K, J, I, H, G, and F live in a six- floor building. The bottommost floor is numbered as 1 and the topmost floor is numbered as 6. H lives im...
Who among the following person sits fourth to the left of N?
Statements: J = S ≤ A = Y > X, W ≥ J > O = B
Conclusion:
I. W ≥ S
II. S > B
III. B < A