mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-05 16:27:33 +08:00
Refactor files to be in correctly nested packages (#6120)
This commit is contained in:
@ -55,7 +55,6 @@ com.thealgorithms.maths.SumOfArithmeticSeries=UselessParentheses
|
|||||||
com.thealgorithms.maths.TrinomialTriangle=UselessParentheses
|
com.thealgorithms.maths.TrinomialTriangle=UselessParentheses
|
||||||
com.thealgorithms.maths.VampireNumber=CollapsibleIfStatements
|
com.thealgorithms.maths.VampireNumber=CollapsibleIfStatements
|
||||||
com.thealgorithms.maths.Volume=UselessParentheses
|
com.thealgorithms.maths.Volume=UselessParentheses
|
||||||
com.thealgorithms.matrixexponentiation.Fibonacci=UnnecessaryFullyQualifiedName
|
|
||||||
com.thealgorithms.misc.Sparsity=UselessParentheses
|
com.thealgorithms.misc.Sparsity=UselessParentheses
|
||||||
com.thealgorithms.misc.ThreeSumProblem=UselessParentheses
|
com.thealgorithms.misc.ThreeSumProblem=UselessParentheses
|
||||||
com.thealgorithms.misc.WordBoggle=UselessParentheses
|
com.thealgorithms.misc.WordBoggle=UselessParentheses
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package com.thealgorithms.misc;
|
package com.thealgorithms.matrix;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class provides methods to compute the inverse of a square matrix
|
* This class provides methods to compute the inverse of a square matrix
|
@ -1,4 +1,4 @@
|
|||||||
package com.thealgorithms.misc;
|
package com.thealgorithms.matrix;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
@ -1,4 +1,4 @@
|
|||||||
package com.thealgorithms.misc;
|
package com.thealgorithms.matrix;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
@ -1,4 +1,4 @@
|
|||||||
package com.thealgorithms.misc;
|
package com.thealgorithms.matrix;
|
||||||
|
|
||||||
// Problem Statement
|
// Problem Statement
|
||||||
/*
|
/*
|
@ -1,4 +1,4 @@
|
|||||||
package com.thealgorithms.others;
|
package com.thealgorithms.matrix;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
@ -1,4 +1,4 @@
|
|||||||
package com.thealgorithms.others;
|
package com.thealgorithms.matrix;
|
||||||
|
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
/**
|
/**
|
@ -1,4 +1,4 @@
|
|||||||
package com.thealgorithms.matrixexponentiation;
|
package com.thealgorithms.matrix.matrixexponentiation;
|
||||||
|
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
@ -55,14 +55,14 @@ public final class Fibonacci {
|
|||||||
*/
|
*/
|
||||||
public static int[][] fib(int n) {
|
public static int[][] fib(int n) {
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
return Fibonacci.IDENTITY_MATRIX;
|
return IDENTITY_MATRIX;
|
||||||
} else {
|
} else {
|
||||||
int[][] cachedResult = fib(n / 2);
|
int[][] cachedResult = fib(n / 2);
|
||||||
int[][] matrixExpResult = matrixMultiplication(cachedResult, cachedResult);
|
int[][] matrixExpResult = matrixMultiplication(cachedResult, cachedResult);
|
||||||
if (n % 2 == 0) {
|
if (n % 2 == 0) {
|
||||||
return matrixExpResult;
|
return matrixExpResult;
|
||||||
} else {
|
} else {
|
||||||
return matrixMultiplication(Fibonacci.FIB_MATRIX, matrixExpResult);
|
return matrixMultiplication(FIB_MATRIX, matrixExpResult);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,5 +1,4 @@
|
|||||||
package com.thealgorithms.misc;
|
package com.thealgorithms.matrix;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||||
|
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
@ -1,4 +1,4 @@
|
|||||||
package com.thealgorithms.misc;
|
package com.thealgorithms.matrix;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
@ -1,4 +1,4 @@
|
|||||||
package com.thealgorithms.misc;
|
package com.thealgorithms.matrix;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.thealgorithms.misc;
|
package com.thealgorithms.matrix;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
@ -1,4 +1,4 @@
|
|||||||
package com.thealgorithms.others;
|
package com.thealgorithms.matrix;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertIterableEquals;
|
import static org.junit.jupiter.api.Assertions.assertIterableEquals;
|
||||||
|
|
Reference in New Issue
Block a user