Skip to content

Commit 1da6ac0

Browse files
committed
Bubble SORT
1 parent 169d30a commit 1da6ac0

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

Sorting/Untitled.ipynb

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,29 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 1,
5+
"execution_count": 11,
66
"metadata": {},
77
"outputs": [
8+
{
9+
"name": "stdin",
10+
"output_type": "stream",
11+
"text": [
12+
"Enter N 4\n",
13+
" 3\n",
14+
" 2\n",
15+
" 4\n",
16+
" 1\n"
17+
]
18+
},
819
{
920
"name": "stdout",
1021
"output_type": "stream",
1122
"text": [
1223
"Sorted array is:\n",
13-
"11\n",
14-
"12\n",
15-
"22\n",
16-
"25\n",
17-
"34\n",
18-
"64\n",
19-
"90\n"
24+
"1\n",
25+
"2\n",
26+
"3\n",
27+
"4\n"
2028
]
2129
}
2230
],
@@ -32,7 +40,10 @@
3240
" \n",
3341
"\n",
3442
"arr = []\n",
35-
" \n",
43+
"n=int(input(\"Enter N\"))\n",
44+
"for x in range(n):\n",
45+
" arr.append(int(input()))\n",
46+
"\n",
3647
"bubbleSort(arr)\n",
3748
" \n",
3849
"print (\"Sorted array is:\")\n",

0 commit comments

Comments
 (0)