public class BitwiseFastExponential { public static int FastExpo(int a, int n){ int answer =1; while(n>0){ if((n&1)!=0){ answer =answera; } a=aa; n=n>>1; } return answer; } public static void main(String[] args) { System.out.println(FastExpo(5, 3)); } }
rishav9250 / bitwisefastexponential Goto Github PK
View Code? Open in Web Editor NEWhere is a code of BitwiseFastExponential in java.