public boolean isAllCellTraversed(Cell grid[][]){
		boolean[][] visited = new boolean[grid.length][grid[0].length];
		
		int total = grid.length * grid[0].length;
		int startx = grid[0][0].x;
		int starty = grid[0][0].y;
		for(int i=0; i < total-2; i++){
			if(grid[startx][starty] == null){
				return false;
			}
			if(visited[startx][starty] == true){
				return false;
			}
			visited[startx][starty] = true;
			int x = grid[startx][starty].x;
			int y = grid[startx][starty].y;
			startx = x;
			starty = y;
		}
		if(grid[startx][starty] == null){
			return true;
		}
		return false;
	}
http://www.careercup.com/question?id=6685828805820416
Test Edge cases
Values in cell should be in range of 2D array.
src/com/interview/multiarray/MoveCellPerCellValue.java