Question
5,1,4,2,8 how many more pass are needed to finish
sorting by bubble sorting technique?Solution
First Pass: ( 5 1 4 2 8 ) –> ( 1 5 4 2 8 ), Here, algorithm compares the first two elements, and swaps since 5 > 1. ( 1 5 4 2 8 ) –> ( 1 4 5 2 8 ), Swap since 5 > 4 ( 1 4 5 2 8 ) –> ( 1 4 2 5 8 ), Swap since 5 > 2 ( 1 4 2 5 8 ) –> ( 1 4 2 5 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 ) ( 1 4 2 5 8 ) –> ( 1 2 4 5 8 ), Swap since 4 > 2 ( 1 2 4 5 8 ) –> ( 1 2 4 5 8 ) ( 1 2 4 5 8 ) –> ( 1 2 4 5 8 ) Now, the array is already sorted, but our algorithm does not know if it is completed. The algorithm needs one whole pass without any swap to know it is sorted. Third Pass: ( 1 2 4 5 8 ) –> ( 1 2 4 5 8 ) ( 1 2 4 5 8 ) –> ( 1 2 4 5 8 ) ( 1 2 4 5 8 ) –> ( 1 2 4 5 8 ) ( 1 2 4 5 8 ) –> ( 1 2 4 5 8 )
Angle formed by a attached branch to the trunkÂ
Which plant hormone is used for suicidal germination of Striga seeds?Â
Which of the following tillage equipment, is a secondary tillage equipment?
The most suitable method for testing seed viability quickly is:
Place the following jelly making steps in the correct order-
(A). Add sugar, boil and remove any scum.
(B). Boiling with water and add cit...
The endoplasmic reticulum of adjacent cells is connected byÂ
Which soil is most suitable for groundnut cultivation?
Which among the following is not a plant derived antioxidant?
‘Khaira disease’ (also known as iron rust) of rice is caused due to:
Foliar diagnosis of nutrient status developed for sugarcane crop is known by the nameÂ