Merge pull request #1325 from mariaRoxana94/fix-error

Fixed 8XCorrectness_Bugs + 10XBad_Practice_Bugs + 14XDodgy_Code_Bugs
This commit is contained in:
Stepfen Shawn
2020-05-28 23:04:56 +08:00
committed by GitHub
25 changed files with 293 additions and 238 deletions

View File

@ -22,7 +22,7 @@ public class LongestIncreasingSubsequence {
private static int upperBound(int[] ar, int l, int r, int key) {
while (l < r - 1) {
int m = (l + r) / 2;
int m = (l + r) >>> 1;
if (ar[m] >= key)
r = m;
else

View File

@ -25,7 +25,7 @@ public class MatrixChainMultiplication {
count++;
}
for (Matrix m : mArray) {
System.out.format("A(%d) = %2d x %2d\n", m.count(), m.col(), m.row());
System.out.format("A(%d) = %2d x %2d%n", m.count(), m.col(), m.row());
}
size = mArray.size();