Finds the root and the exponent for a given natural number n
To use this class, just write PerfectPowerAlgorithm.isPerfectPower(n) inside the main class
public int[] isPerfectPower(int n) {
//returns the result in a array form of size two
}
Example code, for understanding:
public static void main(String[] args){
PerfectPowerAlgorithm perfectPower = new PerfectPowerAlgorithm();
System.out.println(perfectPower.isPerfectPower(0));
// returns int array of size two or null otherwise
}