-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathInsertSort.json
More file actions
32 lines (32 loc) · 1.04 KB
/
InsertSort.json
File metadata and controls
32 lines (32 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
"font-normal": "JetBrainsMono-Regular.ttf",
"font-bold": "JetBrainsMono-Bold.ttf",
"font-italic": "JetBrainsMono-BoldItalic.ttf",
"font-bold-italic": "JetBrainsMono-Italic.ttf",
"font-size": 19,
"width-margin": 5,
"height-margin": 5,
"spacing": 1,
"background-color": [
255,
255,
255
],
"source-code": [
" public static int[] sort(int[] unsorted) {",
" for (int i = 1; i < unsorted.length; i++) {",
" for (int j = i; j > 0; j--) {",
" int jthElement = unsorted[j];",
" int jMinusOneElement = unsorted[j - 1];",
" if (jthElement < jMinusOneElement) {",
" unsorted[j - 1] = jthElement;",
" unsorted[j] = jMinusOneElement;",
" } else {",
" break;",
" }",
" }",
" }",
" return unsorted;",
" }"
]
}