Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Bubble Sort
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
class Rextester { public static void main(String args[]) { int max; int A[]={100,8,6,4,2,7,1,0,3,10,9}; for(int i =0;i<A.length-1; i++) { for(int j=0; j<A.length-1; j++) { if(A[j]>A[j+1]) { max = A[j]; A[j] = A[j+ 1]; A[j +1] = max; } } } for(int q = 0; q<A.length; q++){ System.out.print(A[q] + ","); } } }
[
+
]
Show input
Compilation time: 0.84 sec, absolute running time: 0.14 sec, cpu time: 0.08 sec, memory peak: 27 Mb, absolute service time: 0.99 sec
edit mode
|
history
|
discussion
0,1,2,3,4,6,7,8,9,10,100,