Search:

Type: Posts; User: firstTimeJava

Search: Search took 0.13 seconds.

  1. Re: Need a more efficient algorithm for finding the highest pth of a number.

    Yea that's how I figured to get around the math.pow() I was just having some trouble implementing that into the algorithm.
  2. Need a more efficient algorithm for finding the highest pth of a number.

    This is my algorithm so far:


    public static int getPth(int x) {
    int largestP = 1;

    for (int p = 1; p < x; p++) {
    for (int b = 1; b < x; b++) {
    ...
  3. Need a more efficient algorithm for prime numbers.

    Here is my current algorithm, the TimeExec is just a class to print out how long it takes to run the code:



    public class Primes {

    /**
    * Get a set of prime numbers.
    * @param no the...
Results 1 to 3 of 3