public void rotate(int[][] matrix) {
        int length = matrix.length-1;
        int j=0;
        while(j < matrix.length/2){
            for(int i=j; i < length-j; i++){
                int temp = matrix[j][i];
                matrix[j][i] = matrix[length-i][j];
                matrix[length-i][j] = matrix[length-j][length-i];
                matrix[length-j][length-i] = matrix[i][length-j];
                matrix[i][length-j] = temp;
            }
            j++;
        }
    }
Date 07/31/2016
@author Tushar Roy

You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).

https://leetcode.com/problems/rotate-image/
src/com/interview/multiarray/RotateImage.java