private void displayPattern() {
		int l = 0, r = m-1, t = 0, b = n-1;
		int valuesRemaining = m*n;
		int i;

		while(valuesRemaining != 0) {
			for (i = l; i <= r && valuesRemaining != 0; i++) {
				valuesRemaining--;
				System.out.print(arr[t][i] + " ");
			}
			for (i = t+1; i <= b && valuesRemaining != 0; i++) {
				valuesRemaining--;
				System.out.print(arr[i][r] + " ");
			}
			for (i = r-1; i >= l && valuesRemaining != 0; i--) {
				valuesRemaining--;
				System.out.print(arr[b][i] + " ");
			}
			for (i = b-1; i > t && valuesRemaining != 0; i--) {
				valuesRemaining--;
				System.out.print(arr[i][l] + " ");
			}

			l++;
			t++;
			r--;
			b--;
		}
		System.out.println();
	}