bubble sort
Submit
Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.
Problem
Please sort it with the bubble sort in ascending order.
The first line is a number of elements.
Options
exec is denied
now post-mortem time, all source codes will be revealed
Sample input:_
5
36
87
98
18
43
Sample output:
compare = 1 swap = 0 data: 36 87 98 18 43
compare = 2 swap = 0 data: 36 87 98 18 43
compare = 3 swap = 1 data: 36 87 18 98 43
compare = 4 swap = 2 data: 36 87 18 43 98
compare = 5 swap = 2 data: 36 87 18 43 98
compare = 6 swap = 3 data: 36 18 87 43 98
compare = 7 swap = 4 data: 36 18 43 87 98
compare = 8 swap = 5 data: 18 36 43 87 98
compare = 9 swap = 5 data: 18 36 43 87 98
compare = 10 swap = 5 data: 18 36 43 87 98
Sample input:_
8
65
30
96
6
18
40
67
28
Sample output:
compare = 1 swap = 1 data: 30 65 96 6 18 40 67 28
compare = 2 swap = 1 data: 30 65 96 6 18 40 67 28
compare = 3 swap = 2 data: 30 65 6 96 18 40 67 28
compare = 4 swap = 3 data: 30 65 6 18 96 40 67 28
compare = 5 swap = 4 data: 30 65 6 18 40 96 67 28
compare = 6 swap = 5 data: 30 65 6 18 40 67 96 28
compare = 7 swap = 6 data: 30 65 6 18 40 67 28 96
compare = 8 swap = 6 data: 30 65 6 18 40 67 28 96
compare = 9 swap = 7 data: 30 6 65 18 40 67 28 96
compare = 10 swap = 8 data: 30 6 18 65 40 67 28 96
compare = 11 swap = 9 data: 30 6 18 40 65 67 28 96
compare = 12 swap = 9 data: 30 6 18 40 65 67 28 96
compare = 13 swap = 10 data: 30 6 18 40 65 28 67 96
compare = 14 swap = 11 data: 6 30 18 40 65 28 67 96
compare = 15 swap = 12 data: 6 18 30 40 65 28 67 96
compare = 16 swap = 12 data: 6 18 30 40 65 28 67 96
compare = 17 swap = 12 data: 6 18 30 40 65 28 67 96
compare = 18 swap = 13 data: 6 18 30 40 28 65 67 96
compare = 19 swap = 13 data: 6 18 30 40 28 65 67 96
compare = 20 swap = 13 data: 6 18 30 40 28 65 67 96
compare = 21 swap = 13 data: 6 18 30 40 28 65 67 96
compare = 22 swap = 14 data: 6 18 30 28 40 65 67 96
compare = 23 swap = 14 data: 6 18 30 28 40 65 67 96
compare = 24 swap = 14 data: 6 18 30 28 40 65 67 96
compare = 25 swap = 15 data: 6 18 28 30 40 65 67 96
compare = 26 swap = 15 data: 6 18 28 30 40 65 67 96
compare = 27 swap = 15 data: 6 18 28 30 40 65 67 96
compare = 28 swap = 15 data: 6 18 28 30 40 65 67 96
Sample input:_
14
28
78
69
22
54
18
79
85
64
38
27
57
1
13
Sample output:
compare = 1 swap = 0 data: 28 78 69 22 54 18 79 85 64 38 27 57 1 13
compare = 2 swap = 1 data: 28 69 78 22 54 18 79 85 64 38 27 57 1 13
compare = 3 swap = 2 data: 28 69 22 78 54 18 79 85 64 38 27 57 1 13
compare = 4 swap = 3 data: 28 69 22 54 78 18 79 85 64 38 27 57 1 13
compare = 5 swap = 4 data: 28 69 22 54 18 78 79 85 64 38 27 57 1 13
compare = 6 swap = 4 data: 28 69 22 54 18 78 79 85 64 38 27 57 1 13
compare = 7 swap = 4 data: 28 69 22 54 18 78 79 85 64 38 27 57 1 13
compare = 8 swap = 5 data: 28 69 22 54 18 78 79 64 85 38 27 57 1 13
compare = 9 swap = 6 data: 28 69 22 54 18 78 79 64 38 85 27 57 1 13
compare = 10 swap = 7 data: 28 69 22 54 18 78 79 64 38 27 85 57 1 13
compare = 11 swap = 8 data: 28 69 22 54 18 78 79 64 38 27 57 85 1 13
compare = 12 swap = 9 data: 28 69 22 54 18 78 79 64 38 27 57 1 85 13
compare = 13 swap = 10 data: 28 69 22 54 18 78 79 64 38 27 57 1 13 85
compare = 14 swap = 10 data: 28 69 22 54 18 78 79 64 38 27 57 1 13 85
compare = 15 swap = 11 data: 28 22 69 54 18 78 79 64 38 27 57 1 13 85
compare = 16 swap = 12 data: 28 22 54 69 18 78 79 64 38 27 57 1 13 85
compare = 17 swap = 13 data: 28 22 54 18 69 78 79 64 38 27 57 1 13 85
compare = 18 swap = 13 data: 28 22 54 18 69 78 79 64 38 27 57 1 13 85
compare = 19 swap = 13 data: 28 22 54 18 69 78 79 64 38 27 57 1 13 85
compare = 20 swap = 14 data: 28 22 54 18 69 78 64 79 38 27 57 1 13 85
compare = 21 swap = 15 data: 28 22 54 18 69 78 64 38 79 27 57 1 13 85
compare = 22 swap = 16 data: 28 22 54 18 69 78 64 38 27 79 57 1 13 85
compare = 23 swap = 17 data: 28 22 54 18 69 78 64 38 27 57 79 1 13 85
compare = 24 swap = 18 data: 28 22 54 18 69 78 64 38 27 57 1 79 13 85
compare = 25 swap = 19 data: 28 22 54 18 69 78 64 38 27 57 1 13 79 85
compare = 26 swap = 20 data: 22 28 54 18 69 78 64 38 27 57 1 13 79 85
compare = 27 swap = 20 data: 22 28 54 18 69 78 64 38 27 57 1 13 79 85
compare = 28 swap = 21 data: 22 28 18 54 69 78 64 38 27 57 1 13 79 85
compare = 29 swap = 21 data: 22 28 18 54 69 78 64 38 27 57 1 13 79 85
compare = 30 swap = 21 data: 22 28 18 54 69 78 64 38 27 57 1 13 79 85
compare = 31 swap = 22 data: 22 28 18 54 69 64 78 38 27 57 1 13 79 85
compare = 32 swap = 23 data: 22 28 18 54 69 64 38 78 27 57 1 13 79 85
compare = 33 swap = 24 data: 22 28 18 54 69 64 38 27 78 57 1 13 79 85
compare = 34 swap = 25 data: 22 28 18 54 69 64 38 27 57 78 1 13 79 85
compare = 35 swap = 26 data: 22 28 18 54 69 64 38 27 57 1 78 13 79 85
compare = 36 swap = 27 data: 22 28 18 54 69 64 38 27 57 1 13 78 79 85
compare = 37 swap = 27 data: 22 28 18 54 69 64 38 27 57 1 13 78 79 85
compare = 38 swap = 28 data: 22 18 28 54 69 64 38 27 57 1 13 78 79 85
compare = 39 swap = 28 data: 22 18 28 54 69 64 38 27 57 1 13 78 79 85
compare = 40 swap = 28 data: 22 18 28 54 69 64 38 27 57 1 13 78 79 85
compare = 41 swap = 29 data: 22 18 28 54 64 69 38 27 57 1 13 78 79 85
compare = 42 swap = 30 data: 22 18 28 54 64 38 69 27 57 1 13 78 79 85
compare = 43 swap = 31 data: 22 18 28 54 64 38 27 69 57 1 13 78 79 85
compare = 44 swap = 32 data: 22 18 28 54 64 38 27 57 69 1 13 78 79 85
compare = 45 swap = 33 data: 22 18 28 54 64 38 27 57 1 69 13 78 79 85
compare = 46 swap = 34 data: 22 18 28 54 64 38 27 57 1 13 69 78 79 85
compare = 47 swap = 35 data: 18 22 28 54 64 38 27 57 1 13 69 78 79 85
compare = 48 swap = 35 data: 18 22 28 54 64 38 27 57 1 13 69 78 79 85
compare = 49 swap = 35 data: 18 22 28 54 64 38 27 57 1 13 69 78 79 85
compare = 50 swap = 35 data: 18 22 28 54 64 38 27 57 1 13 69 78 79 85
compare = 51 swap = 36 data: 18 22 28 54 38 64 27 57 1 13 69 78 79 85
compare = 52 swap = 37 data: 18 22 28 54 38 27 64 57 1 13 69 78 79 85
compare = 53 swap = 38 data: 18 22 28 54 38 27 57 64 1 13 69 78 79 85
compare = 54 swap = 39 data: 18 22 28 54 38 27 57 1 64 13 69 78 79 85
compare = 55 swap = 40 data: 18 22 28 54 38 27 57 1 13 64 69 78 79 85
compare = 56 swap = 40 data: 18 22 28 54 38 27 57 1 13 64 69 78 79 85
compare = 57 swap = 40 data: 18 22 28 54 38 27 57 1 13 64 69 78 79 85
compare = 58 swap = 40 data: 18 22 28 54 38 27 57 1 13 64 69 78 79 85
compare = 59 swap = 41 data: 18 22 28 38 54 27 57 1 13 64 69 78 79 85
compare = 60 swap = 42 data: 18 22 28 38 27 54 57 1 13 64 69 78 79 85
compare = 61 swap = 42 data: 18 22 28 38 27 54 57 1 13 64 69 78 79 85
compare = 62 swap = 43 data: 18 22 28 38 27 54 1 57 13 64 69 78 79 85
compare = 63 swap = 44 data: 18 22 28 38 27 54 1 13 57 64 69 78 79 85
compare = 64 swap = 44 data: 18 22 28 38 27 54 1 13 57 64 69 78 79 85
compare = 65 swap = 44 data: 18 22 28 38 27 54 1 13 57 64 69 78 79 85
compare = 66 swap = 44 data: 18 22 28 38 27 54 1 13 57 64 69 78 79 85
compare = 67 swap = 45 data: 18 22 28 27 38 54 1 13 57 64 69 78 79 85
compare = 68 swap = 45 data: 18 22 28 27 38 54 1 13 57 64 69 78 79 85
compare = 69 swap = 46 data: 18 22 28 27 38 1 54 13 57 64 69 78 79 85
compare = 70 swap = 47 data: 18 22 28 27 38 1 13 54 57 64 69 78 79 85
compare = 71 swap = 47 data: 18 22 28 27 38 1 13 54 57 64 69 78 79 85
compare = 72 swap = 47 data: 18 22 28 27 38 1 13 54 57 64 69 78 79 85
compare = 73 swap = 48 data: 18 22 27 28 38 1 13 54 57 64 69 78 79 85
compare = 74 swap = 48 data: 18 22 27 28 38 1 13 54 57 64 69 78 79 85
compare = 75 swap = 49 data: 18 22 27 28 1 38 13 54 57 64 69 78 79 85
compare = 76 swap = 50 data: 18 22 27 28 1 13 38 54 57 64 69 78 79 85
compare = 77 swap = 50 data: 18 22 27 28 1 13 38 54 57 64 69 78 79 85
compare = 78 swap = 50 data: 18 22 27 28 1 13 38 54 57 64 69 78 79 85
compare = 79 swap = 50 data: 18 22 27 28 1 13 38 54 57 64 69 78 79 85
compare = 80 swap = 51 data: 18 22 27 1 28 13 38 54 57 64 69 78 79 85
compare = 81 swap = 52 data: 18 22 27 1 13 28 38 54 57 64 69 78 79 85
compare = 82 swap = 52 data: 18 22 27 1 13 28 38 54 57 64 69 78 79 85
compare = 83 swap = 52 data: 18 22 27 1 13 28 38 54 57 64 69 78 79 85
compare = 84 swap = 53 data: 18 22 1 27 13 28 38 54 57 64 69 78 79 85
compare = 85 swap = 54 data: 18 22 1 13 27 28 38 54 57 64 69 78 79 85
compare = 86 swap = 54 data: 18 22 1 13 27 28 38 54 57 64 69 78 79 85
compare = 87 swap = 55 data: 18 1 22 13 27 28 38 54 57 64 69 78 79 85
compare = 88 swap = 56 data: 18 1 13 22 27 28 38 54 57 64 69 78 79 85
compare = 89 swap = 57 data: 1 18 13 22 27 28 38 54 57 64 69 78 79 85
compare = 90 swap = 58 data: 1 13 18 22 27 28 38 54 57 64 69 78 79 85
compare = 91 swap = 58 data: 1 13 18 22 27 28 38 54 57 64 69 78 79 85
Ranking
Rank | User | Size | Time | Date | Statistics |
---|
1 | ksk | 135 | 0.1204 | 2008/11/25 01:14:45 | 0B / 57B / 67B |
2 | leonid | 137 | 0.0660 | 2008/11/24 08:45:46 | 0B / 67B / 58B |
3 | murky-satyr | 142 | 0.0646 | 2008/11/24 20:30:24 | 0B / 69B / 61B |
4 | yowa | 145 | 0.0566 | 2008/11/25 01:56:52 | 0B / 68B / 65B |
5 | mokos | 157 | 0.0987 | 2008/11/30 02:16:08 | 0B / 76B / 69B |
6 | eban | 172 | 0.0736 | 2008/11/25 18:14:01 | 0B / 82B / 71B |
7 | tabasa | 192 | 0.0705 | 2008/11/25 05:18:07 | 0B / ?B / ?B |
8 | murky-satyr | 135 | 0.1165 | 2008/12/03 06:17:01 | 0B / 67B / 56B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | ySas | 133 | 0.0448 | 2008/11/24 21:56:03 | 0B / ?B / ?B |
2 | Mithran | 133 | 0.0377 | 2008/11/28 12:05:06 | 0B / 36B / 89B |
3 | tails (ySas) | 128 | 0.0453 | 2024/02/28 10:34:30 | 0B / 45B / 75B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | kt3k | 183 | 0.2173 | 2008/11/24 07:37:54 | 0B / 99B / 62B |
2 | recursive | 191 | 0.1052 | 2008/12/31 05:23:31 | 0B / 101B / 69B |
3 | rolf | 225 | 0.0717 | 2017/11/21 03:50:45 | 0B / 114B / 73B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | o-cn | 180 | 0.0224 | 2009/12/26 03:16:51 | 108B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | kozima | 213 | 1.9934 | 2008/11/26 09:14:02 | 0B / 115B / 65B |
2 | kozima | 206 | 1.2890 | 2008/12/01 13:55:30 | 0B / 115B / 63B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | murky-satyr | 215 | 1.3627 | 2008/11/26 03:53:48 | 0B / 132B / 67B |
2 | pooq | 278 | 1.1875 | 2008/11/25 21:06:39 | 0B / 168B / 82B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | nn | 183 | 0.0574 | 2008/11/24 23:40:57 | 0B / 85B / 90B |
2 | murky-satyr | 183 | 0.1249 | 2008/11/26 03:43:15 | 0B / 81B / 97B |
3 | nn | 179 | 0.1389 | 2008/12/01 23:16:04 | 0B / 78B / 96B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 226 | 0.4363 | 2008/11/25 21:59:38 | 0B / 124B / 67B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 204 | 0.2773 | 2008/11/29 14:48:39 | 0B / 85B / 97B |
2 | pooq | 195 | 0.1477 | 2011/01/30 08:54:55 | 0B / 83B / 91B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | 51b | 205 | 0.0436 | 2008/11/24 19:53:02 | 0B / 96B / 101B |
2 | Purika | 242 | 0.0810 | 2008/11/30 04:48:18 | 0B / ?B / ?B |
3 | mazun | 247 | 0.1270 | 2008/11/30 03:08:42 | 0B / 119B / 120B |
4 | 51b | 204 | 0.1008 | 2009/01/18 22:25:48 | 0B / 96B / 100B |
5 | inaniwa | 381 | 0.0014 | 2009/12/16 17:02:47 | 19B / 126B / 129B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | 51b | 240 | 0.0514 | 2009/01/18 22:24:03 | 0B / 123B / 106B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | ksk | 248 | 0.7024 | 2008/11/29 00:59:36 | 0B / 135B / 92B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | uru | 292 | 0.2751 | 2009/07/27 23:47:24 | 0B / 178B / 90B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 213 | 0.0646 | 2008/11/29 13:06:03 | 0B / 119B / 69B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 217 | 0.8492 | 2009/03/07 12:47:31 | 0B / 119B / 72B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | nn | 162 | 0.1388 | 2008/11/25 18:51:45 | 0B / 76B / 72B |
2 | Fleur | 139 | 0.0386 | 2024/02/28 17:41:00 | 0B / 59B / 67B |
3 | nn | 160 | 0.0396 | 2009/08/25 00:28:07 | 0B / 76B / 72B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | emoken | 474 | 0.0943 | 2008/11/25 18:22:55 | 0B / 147B / 251B |
2 | tails (%20) | 275 | 0.6839 | 2018/06/13 18:13:18 | 0B / 84B / 153B |
3 | %20 | 297 | 0.6867 | 2018/06/13 08:25:54 | 0B / 88B / 167B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | ySas | 165 | 1.2096 | 2008/12/01 01:15:07 | 47B / ?B / ?B |
2 | yshl(bin) | 166 | 1.3438 | 2008/11/25 01:06:08 | 62B / 62B / 27B |
3 | yshl | 248 | 1.1463 | 2008/11/25 01:05:58 | 0B / 161B / 41B |
4 | ySas (no bin) | 292 | 1.2890 | 2008/12/01 01:43:12 | 0B / 205B / 35B |
5 | yshl(bin) | 160 | 1.4885 | 2008/12/06 17:50:43 | 58B / 60B / 27B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 225 | 4.2887 | 2008/11/29 13:39:06 | 0B / 115B / 91B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 62 | 0.2411 | 2018/06/14 11:56:40 | 14B / 29B / 14B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | murky-satyr | 170 | 3.6354 | 2010/01/03 05:01:32 | 0B / 89B / 71B |
2 | nn | 212 | 7.3833 | 2009/11/07 00:25:08 | 0B / 104B / 91B |
Language Ranking_
Rank | Lang | User | Size | Score |
1 | gs2 | tails | 62 | 10000 |
2 | goruby | murky-satyr | 118 | 5254 |
3 | Perl | tails (ySas) | 128 | 4843 |
4 | Ruby | ksk | 135 | 4592 |
5 | AWK | Fleur | 139 | 4460 |
6 | Postscript | yshl(bin) | 160 | 3875 |
7 | Groovy | murky-satyr | 170 | 3647 |
8 | JavaScript | nn | 179 | 3463 |
9 | PHP | o-cn | 180 | 3444 |
10 | Python | kt3k | 183 | 3387 |
11 | J | pooq | 195 | 3179 |
12 | C | 51b | 204 | 3039 |
13 | Common LISP | kozima | 206 | 3009 |
14 | Fortran | pooq | 213 | 2910 |
15 | Io | murky-satyr | 215 | 2883 |
16 | Maxima | pooq | 217 | 2857 |
17 | R | pooq | 225 | 2755 |
18 | BASIC | pooq | 226 | 2743 |
19 | Lua | murky-satyr | 227 | 2731 |
20 | D | 51b | 240 | 2583 |
21 | OCaml | ksk | 248 | 2500 |
22 | Haskell | notogawa | 248 | 2500 |
23 | sed | tails (%20) | 275 | 2254 |
24 | Pascal | uru | 292 | 2123 |
return to the top page