Search:

Type: Posts; User: Mr.777

Search: Search took 0.16 seconds.

  1. Re: Python code to Java, Incorrect answers returned in Java. Did I type something wr

    I'll recommend you to read these:
    1
    2
    3
  2. Re: Python code to Java, Incorrect answers returned in Java. Did I type something wr

    Why don't you try making it iterative?
  3. Re: Python code to Java, Incorrect answers returned in Java. Did I type something wr

    Man!!! Try writing a factorial program and give it a value of 100 and run it, you'll come to know the result...
  4. Re: Python code to Java, Incorrect answers returned in Java. Did I type something wr

    And what's your RAM size by the way? Of course when you will input too large values, your RAM will definitely let it's stack overflow as you are using recursion. If you still want to do this,...
  5. Re: Python code to Java, Incorrect answers returned in Java. Did I type something wr

    else if (2%p == 1) // if odd
    {

    r= modPower(x, ((int)(p/2)), m);
    r *= r;
    }
    else // if even
    {

    r = x * modPower(x, p-1, m);
  6. Re: Python code to Java, Incorrect answers returned in Java. Did I type something wr

    1. Hopefully some type casting issues.
    2. Did you declare ret somewhere? I mean it is declared and initialized in your whole program?
    3. As you are new to Java, may be you are missing main()...
Results 1 to 6 of 6