public int longestConsecutiveInteger(int input[][]){
	
		boolean visited[][] = new boolean[input.length][input[0].length];
		int max = 1;
		for(int i=0; i < input.length; i++){
			for(int j=0; j < input[i].length; j++){
				int r = DFS(input,i,j,visited,-10000);
				if(r > max){
					max = r;
				}
			}
		}
		return max;
	}
Find the length of the longest chain of consecutive integers in an unsorted 2D square array (non-diagonal)
src/com/interview/multiarray/LongestConsecutiveIntegerInUnsorted2DArray.java