Skip to content

Commit a40d9c4

Browse files
committed
Formatted
1 parent 4d90d58 commit a40d9c4

File tree

4 files changed

+4
-19
lines changed

4 files changed

+4
-19
lines changed

src/main/java/com/thealgorithms/divideandconquer/BinaryExponentiation.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
*/
1414

1515
public class BinaryExponentiation {
16-
1716
// recursive function to calculate a to the power of b
1817
public static long calculatePower(long x, long y) {
1918
// Base Case

src/main/java/com/thealgorithms/divideandconquer/ClosestPair.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* class calculates the two closest points.
66
*/
77
public final class ClosestPair {
8-
98
/**
109
* Number of points
1110
*/
@@ -52,7 +51,6 @@ public static void setSecondCount(int secondCount) {
5251
* Location class is an auxiliary type to keep points coordinates.
5352
*/
5453
public static class Location {
55-
5654
double x;
5755
double y;
5856

src/main/java/com/thealgorithms/divideandconquer/SkylineAlgorithm.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
* conquer algorithm
1111
*/
1212
public class SkylineAlgorithm {
13-
1413
private ArrayList<Point> points;
1514

1615
/**
@@ -126,7 +125,6 @@ public ArrayList<Point> produceFinalSkyLine(ArrayList<Point> left, ArrayList<Poi
126125
}
127126

128127
public static class Point {
129-
130128
private int x;
131129
private int y;
132130

@@ -175,7 +173,6 @@ public boolean dominates(Point p1) {
175173
* order get sorted later.
176174
*/
177175
class XComparator implements Comparator<Point> {
178-
179176
@Override
180177
public int compare(Point a, Point b) {
181178
return Integer.compare(a.x, b.x);

src/main/java/com/thealgorithms/divideandconquer/StrassenMatrixMultiplication.java

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717

1818
public class StrassenMatrixMultiplication {
19-
2019
// Function to multiply matrices
2120
public int[][] multiply(int[][] a, int[][] b) {
2221
int n = a.length;
@@ -99,9 +98,7 @@ public int[][] sub(int[][] a, int[][] b) {
9998
int[][] c = new int[n][n];
10099

101100
for (int i = 0; i < n; i++) {
102-
for (int j = 0; j < n; j++) {
103-
c[i][j] = a[i][j] - b[i][j];
104-
}
101+
for (int j = 0; j < n; j++) { c[i][j] = a[i][j] - b[i][j]; }
105102
}
106103

107104
return c;
@@ -114,9 +111,7 @@ public int[][] add(int[][] a, int[][] b) {
114111
int[][] c = new int[n][n];
115112

116113
for (int i = 0; i < n; i++) {
117-
for (int j = 0; j < n; j++) {
118-
c[i][j] = a[i][j] + b[i][j];
119-
}
114+
for (int j = 0; j < n; j++) { c[i][j] = a[i][j] + b[i][j]; }
120115
}
121116

122117
return c;
@@ -125,18 +120,14 @@ public int[][] add(int[][] a, int[][] b) {
125120
// Function to split parent matrix into child matrices
126121
public void split(int[][] p, int[][] c, int iB, int jB) {
127122
for (int i1 = 0, i2 = iB; i1 < c.length; i1++, i2++) {
128-
for (int j1 = 0, j2 = jB; j1 < c.length; j1++, j2++) {
129-
c[i1][j1] = p[i2][j2];
130-
}
123+
for (int j1 = 0, j2 = jB; j1 < c.length; j1++, j2++) { c[i1][j1] = p[i2][j2]; }
131124
}
132125
}
133126

134127
// Function to join child matrices into (to) parent matrix
135128
public void join(int[][] c, int[][] p, int iB, int jB) {
136129
for (int i1 = 0, i2 = iB; i1 < c.length; i1++, i2++) {
137-
for (int j1 = 0, j2 = jB; j1 < c.length; j1++, j2++) {
138-
p[i2][j2] = c[i1][j1];
139-
}
130+
for (int j1 = 0, j2 = jB; j1 < c.length; j1++, j2++) { p[i2][j2] = c[i1][j1]; }
140131
}
141132
}
142133
}

0 commit comments

Comments
 (0)