Timeline for Swap initialised in Bubble sort
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 20, 2015 at 23:15 | comment | added | Cliff B | Yes, swaps will only be the number of swaps on the latest iteration. Remember, the idea here is to track whether the latest pass has had no swaps. Also, you should know that when an int evaluates to 0, it would be treated as false. Any other integer value is considered true. So, when swaps is >0, ` !swaps ` evaluates to false, triggering another pass. | |
Apr 20, 2015 at 22:04 | comment | added | AU786 | When the program is finished, will the value of the swaps be the quantity of the totals swaps made, or just the quantity of the swaps made in one iteration? From the image above, it seems that it is the quantity in one iteration. | |
Apr 20, 2015 at 21:58 | comment | added | AU786 | I feel like I am getting there, so here's some clarifying questions. | |
Apr 20, 2015 at 21:40 | history | answered | Cliff B | CC BY-SA 3.0 |