Bubble Sort - The arithmetic always queried by interviewer

阅读更多
/**
 * 
 * @author tanglei
 * @since  07.27
 */

public class MaoPao {
	public static void main(String[] args){
	    int a[] = {5,4,3,2,1} ;
	    for(int i=0;ia[j+1])
	          {
	             temp  = a[j];
	             a[j] = a[j+1];
	             a[j+1]  = temp;
	          }
	       }    
	    }
	    for(int k=0;k 
 

    Output :

                   1

                   2

                   3

                   4

                   5

你可能感兴趣的:(J#)