Skip to content

Commit 467b495

Browse files
author
Darshana
committed
path change
1 parent 01e815b commit 467b495

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class InsertionSort{
2+
public static int[] insertionSort(int[] inputArray){
3+
int n = inputArray.length;
4+
5+
for (int i = 1; i < n; i++){
6+
key = inputArray[i];
7+
int j = i-1;
8+
9+
while (j >= 0 && inputArray[j]>key){
10+
inputArray[j+1] = inputArray[j];
11+
j = j -1;
12+
}
13+
inputArray[j+1] = key;
14+
}
15+
return inputArray;
16+
}
17+
}

InsertionSort/python]/insertionSort.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)