FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Data-Structures-Algorithms/Sorting/Insertionsort.cpp at master · hugomd/Data-Structures-Algorithms · GitHub
hugomd
/
Data-Structures-Algorithms
Public
forked from
CodersForLife/Data-Structures-Algorithms
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
Data-Structures-Algorithms
/
Sorting
/
Insertionsort.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (20 loc) · 421 Bytes
Breadcrumbs
Data-Structures-Algorithms
/
Sorting
/
Insertionsort.cpp
Copy path
File metadata and controls
23 lines (20 loc) · 421 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//
//
Created by Tay on 10/11/17.
//
void
insertionSort
(
int
table[],
int
size) {
int
key, j;
for
(
int
i =
1
; i < size; i++) {
key = table[i];
j = i -
1
;
while
(j >=
0
&& table[j] > key) {
table[j +
1
] = table[j];
j--;
}
table[j +
1
] = key;
}
}
int
main
() {
int
table[] = {
13
,
32
,
43
,
14
,
25
};
insertionSort
(table,
5
);
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL