sweet1cris

Untitled

Feb 7th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1. public class Solution {
  2.     /**
  3.      * @param A an integer array
  4.      * @return void
  5.      */
  6.     public void sortIntegers(int[] A) {
  7.         // Write your code here
  8.         int n = A.length;
  9.         for (int i = 0; i < n; ++i)
  10.             for (int j = i+1; j < n; ++j)
  11.                 if (A[j] < A[i]) {
  12.                     int t = A[j];
  13.                     A[j] = A[i];
  14.                     A[i] = t;
  15.                 }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment