Skip to content

Commit 2e1f131

Browse files
committed
Added Insertion sort
1 parent 1cd9f76 commit 2e1f131

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

Sorting/InsertionSort.ipynb

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,34 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": null,
5+
"execution_count": 3,
66
"metadata": {},
7-
"outputs": [],
7+
"outputs": [
8+
{
9+
"name": "stdin",
10+
"output_type": "stream",
11+
"text": [
12+
"Enter N 4\n",
13+
" 3\n",
14+
" 2\n",
15+
" 5\n",
16+
" 6\n"
17+
]
18+
},
19+
{
20+
"name": "stdout",
21+
"output_type": "stream",
22+
"text": [
23+
"Sorted array is:\n",
24+
"2\n",
25+
"3\n",
26+
"5\n",
27+
"6\n"
28+
]
29+
}
30+
],
831
"source": [
9-
"### def Selection(arr):\n",
32+
"def Selection(arr):\n",
1033
" n = len(arr)\n",
1134
"\n",
1235
" for i in range(1, len(arr)): \n",

0 commit comments

Comments
 (0)