UNITY (programming language): Difference between revisions

Content deleted Content added
Yobot (talk | contribs)
m WP:CHECKWIKI errors fixed + general fixes using AWB (8961)
m WPCleaner v1.26 - Repaired 1 link to disambiguation page - (You can help) - Adjacent
Line 14:
===Bubble sort===
 
[[Bubble sort]] the array by comparing [[adjacent]] numbers, and swapping them if they are in the wrong order. Using <math>\Theta(n)</math> expected time, <math>\Theta(n)</math> processors and <math>\Theta(n^2)</math> expected work. The reason you only have <math>\Theta(n)</math> ''expected'' time, is that <code>k</code> is always chosen randomly from <math>\{0,1\}</math>. This can be fixed by flipping <code>k</code> manually.
 
Program bubblesort