Skip to content

Commit 9beed5f

Browse files
authored
Update README.md
Completed Insertion Sort Guide
1 parent 6e08c10 commit 9beed5f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Insertion Sort/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,15 @@
1313

1414
### Pseudocode Example:
1515
```
16-
16+
FOR index = 1 TO length(list) - 1
17+
currentval = list [index]
18+
position = index
19+
WHILE position > 0 AND (list [position-1] > currentval)
20+
list[position] = list [position-1]
21+
position -= 1
22+
END WHILE
23+
SET list[position] = currentval
24+
END FOR
1725
```
1826

1927
### This is a very common sorting algorithm and can be implemented in pretty much every language.<br>Check out the rest of this folder to see some examples of it at work!

0 commit comments

Comments
 (0)