Question:
Bubble sort versus optimized bubble sort?
archiphoto77
2011-11-01 10:53:44 UTC
Suppose you sort the following array using bubble sort and also using the optimized version of bubble sort.

{4 2 9 7 10 1 22 5}

The number of passes through the array made by each algorithm is:

a) Bubble Sort: 7, Optimized Bubble Sort: 4
b) Bubble Sort: 8, Optimized Bubble Sort: 4
c) Bubble Sort: 7, Optimized Bubble Sort: 3
d) Bubble Sort: 8, Optimized Bubble Sort: 4
e) Bubble Sort: 6, Optimized Bubble Sort: 3

Please explain your answer.
Three answers:
TheMadProfessor
2011-11-01 11:04:01 UTC
I'm not familiar with the OBS right off the top of my head. However, the number of passes a regular bubble sort would make thru the array is 7, which narrows the possibilities down to two. If I had to hazard a guess, what they call an optimized bubble sort is what I call a double-bubble sort. If so, the answer would be 'a'.
?
2016-12-08 14:59:02 UTC
Optimized Bubble Sort
presnar
2016-10-22 17:11:49 UTC
Why does no different developed usa have the previous US form of healthcare? because of the fact interior the U. S. form, formerly the reforms, coverage firms used dying panels to disclaim care to those they have been meant to cover. and then they raised expenses. not in basic terms does the rustic spend greater on healthcare than the different usa, it properly-knownshows itself backside of the table whilst it is composed of preventable deaths through treatable situations whilst it is composed of developed countries. the unhappy element is that somewhat than concentration on those issues, the splendid spreads lies and a million/2 truths on the subject of the reforms and howhealthcare works in a foreign country. Even sadder is the reality that the reforms are so basic. yet i think of the saddest issues are the form of youngsters in united states of america of america who die. i don't in basic terms like the difficulty that interior the united kingdom, we've a severe dying fee of youngsters elderly decrease than 5 whilst in comparison with different countries, however the rustic, the main developed usa interior the worldwide have a good bigger dying fee for babies elderly decrease than 5. and to boot to that, look on the maternal mortality fee for the rustic. In English it potential the form of ladies people who die whilst they're pregnant (or quickly after) that are through issues related to the being pregnant. it somewhat is bigger interior the rustic than it somewhat is in different developed countries.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...