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 )
If 40% of 'P' is 60 less than 30% of 'Q', then find 250% of 'Q', given that (P + Q) = 900.
Two students appeared in an exam and one secured 12 marks more than the other. If marks of student who got more marks is 55% of the sum of the marks of ...
Suyash have total amount of Rs.2800 out of which, he spent 25% on food, 30% of the rest on travelling. Out of remaining amount he spends Rs.800 on misce...
In a school, 40% of the students are girls, and the rest are boys. During the annual sports event, 30% of the girls and 50% of the boys took part. If th...
Raj's income is ₹60,000 and his expenditure is ₹40,000. If his income is increased by 25% and expenditure by 15%, then what will be the percentage i...
A, B, C, and D purchased a cine-multiplex for Rs. 56 lakhs. The contribution of B, C, and D together is 366.66% that of B’s contribution and contribut...
The income of Tina is Rs.21000 and she saves 20% of her income. The savings of Kajal is Rs.1500 more than that of Tina and she spends 40% of her income....
Rajesh spent 44% of his monthly income on food and 56% of the remaining of study. If total monthly savings (after spending on food and study) of Rajesh ...
If a book was sold at 20% profit and the cost price & selling price of the book is increased by Rs. 40 and Rs. 96 respectively. The new profit percentag...
The total population of a village is 12600. If the rate of growth of male population is 20% per year and the rate of growth of female population is 10% ...