User Profile

Collapse

Profile Sidebar

Collapse
hebaahmed
hebaahmed
Last Activity: May 19 '10, 05:57 PM
Joined: May 11 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • hebaahmed
    started a topic benes looping algorithm
    in Java

    benes looping algorithm

    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...
    See more | Go to post

  • hebaahmed
    replied to random prime number generation for RSA
    in Java
    Thanks for your reply. I can do it.
    See more | Go to post
    Last edited by Niheel; May 13 '10, 02:56 AM. Reason: spelling, grammar, punctuation

    Leave a comment:


  • hebaahmed
    replied to random prime number generation for RSA
    in Java
    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
    ...
    See more | Go to post
    Last edited by Niheel; May 13 '10, 02:55 AM. Reason: code tags, grammar, spelling

    Leave a comment:


  • hebaahmed
    started a topic random prime number generation for RSA
    in Java

    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 () %
    ...
    See more | Go to post
No activity results to display
Show More
Working...