File tree Expand file tree Collapse file tree 1 file changed +65
-0
lines changed Expand file tree Collapse file tree 1 file changed +65
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "cells" : [
3+ {
4+ "cell_type" : " code" ,
5+ "execution_count" : 1 ,
6+ "metadata" : {},
7+ "outputs" : [
8+ {
9+ "name" : " stdout" ,
10+ "output_type" : " stream" ,
11+ "text" : [
12+ " 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 "
20+ ]
21+ }
22+ ],
23+ "source" : [
24+ " def bubbleSort(arr):\n " ,
25+ " n = len(arr)\n " ,
26+ " \n " ,
27+ " for i in range(n):\n " ,
28+ " \n " ,
29+ " for j in range(0, n-i-1):\n " ,
30+ " if arr[j] > arr[j+1] :\n " ,
31+ " arr[j], arr[j+1] = arr[j+1], arr[j]\n " ,
32+ " \n " ,
33+ " \n " ,
34+ " arr = []\n " ,
35+ " \n " ,
36+ " bubbleSort(arr)\n " ,
37+ " \n " ,
38+ " print (\" Sorted array is:\" )\n " ,
39+ " for i in range(len(arr)):\n " ,
40+ " print (\" %d\" %arr[i]),"
41+ ]
42+ }
43+ ],
44+ "metadata" : {
45+ "kernelspec" : {
46+ "display_name" : " Python 3" ,
47+ "language" : " python" ,
48+ "name" : " python3"
49+ },
50+ "language_info" : {
51+ "codemirror_mode" : {
52+ "name" : " ipython" ,
53+ "version" : 3
54+ },
55+ "file_extension" : " .py" ,
56+ "mimetype" : " text/x-python" ,
57+ "name" : " python" ,
58+ "nbconvert_exporter" : " python" ,
59+ "pygments_lexer" : " ipython3" ,
60+ "version" : " 3.7.4"
61+ }
62+ },
63+ "nbformat" : 4 ,
64+ "nbformat_minor" : 4
65+ }
You can’t perform that action at this time.
0 commit comments