if input and output:
0 1 2 3 4 5 6 7 =>input
5 7 1 2 6 4 0 3 =>output
each element must go to the below one as 0 to 5, 1 to 7 etc
i want to know if input 0 to 5 the next must be 4 but from output to 5 in input then take 4 in input to 6 in output then take 7 from output to 1 in input and etc
i want know how to do this by java code please help me thanks
note: in benes 0,1 /2,3/4,5/6,7 in each group...
User Profile
Collapse
-
benes looping algorithm
-
Thanks for your reply. I can do it. -
Code:public static boolean isPrime(int n) { for(int i=2;2*i<n;i++) { if(n%i==0) return false; } return true; } public static void main(String[] args) throws IOException { int q=0; int p=0; int maxValue = 100; int maxNumber = 2; Random x = new Random (); for (int k=1; k < maxNumber; k ++) { p = (Math.abs(x.nextInt
Leave a comment:
-
random prime number generation for RSA
How do I determine random prime numbers in RSA? I have already generated numbers but can't check if prime or not.
Here is the part of generation
Code:public static void main(String[] args) throws IOException { int q=0; int p=0; int maxValue = 100; int maxNumber = 2; Random x = new Random (); for (int k=1; k < maxNumber; k ++) { p = (Math.abs(x.nextInt () %
No activity results to display
Show More
Leave a comment: