Skip to content

Commit 4251b76

Browse files
committed
Removing all CheckStyle issues
1 parent bcb26d1 commit 4251b76

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

src/main/java/com/thealgorithms/others/PrintAMatrixInSpiralOrder.java

-13
Original file line numberDiff line numberDiff line change
@@ -12,54 +12,41 @@ public class PrintAMatrixInSpiralOrder {
1212
* @param col number of columns matrix has
1313
* @author Sadiul Hakim : https://github.com/sadiul-hakim
1414
*/
15-
1615
public List<Integer> print(int[][] matrix, int row, int col) {
17-
1816
// r traverses matrix row wise from first
1917
int r = 0;
2018
// c traverses matrix column wise from first
2119
int c = 0;
2220
int i;
23-
2421
List<Integer> result = new ArrayList<>();
25-
2622
while (r < row && c < col) {
2723
// print first row of matrix
2824
for (i = c; i < col; i++) {
2925
result.add(matrix[r][i]);
3026
}
31-
3227
// increase r by one because first row printed
3328
r++;
34-
3529
// print last column
3630
for (i = r; i < row; i++) {
3731
result.add(matrix[i][col - 1]);
3832
}
39-
4033
// decrease col by one because last column has been printed
4134
col--;
42-
4335
// print rows from last except printed elements
4436
if (r < row) {
4537
for (i = col - 1; i >= c; i--) {
4638
result.add(matrix[row - 1][i]);
4739
}
48-
4940
row--;
50-
5141
}
52-
5342
// print columns from first except printed elements
5443
if (c < col) {
5544
for (i = row - 1; i >= r; i--) {
5645
result.add(matrix[i][c]);
5746
}
5847
c++;
5948
}
60-
6149
}
6250
return result;
6351
}
64-
6552
}

src/main/java/com/thealgorithms/searches/SearchInARowAndColWiseSortedMatrix.java

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.thealgorithms.searches;
22

3-
43
public class SearchInARowAndColWiseSortedMatrix {
54
/**
65
* Search a key in row and column wise sorted matrix

0 commit comments

Comments
 (0)