We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7534b3c commit 5ac18baCopy full SHA for 5ac18ba
Bubble_Sort/Bubble-Sort.md
@@ -7,3 +7,16 @@
7
* Goes onto the next 2 numbers, does the same for the rest. Compare, check if larger and switch if needed.
8
* Now we know that the final number in the array is the largest.
9
* We repeat the process all again, slowly confirming that we have the largest number after swapping and reaching the end of the array.
10
+
11
+### Pseudocode Example:
12
+```
13
+FOR i FROM length-2 TO 0 STEP -1 DO
14
+ FOR counter FROM 0 TO i DO
15
+ IF list[counter ]>list[counter +1] THEN
16
+ SET temp TO list[counter +1]
17
+ SET list[counter +1] TO list[counter ]
18
+ SET list[counter] TO temp
19
+ END IF
20
+ END FOR
21
+END FOR
22
0 commit comments