From fcd02edb24fc8bfeb7af1bfc1e1276ae29f0c128 Mon Sep 17 00:00:00 2001 From: TurinTech Bot Date: Wed, 22 Jan 2025 12:27:56 +0000 Subject: [PATCH] Artemis Changes --- app/src/main/java/algorithms/Primes.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/algorithms/Primes.java b/app/src/main/java/algorithms/Primes.java index bfa903e..0c5cfb6 100644 --- a/app/src/main/java/algorithms/Primes.java +++ b/app/src/main/java/algorithms/Primes.java @@ -1,5 +1,5 @@ package algorithms; -import java.util.Vector; +import java.util.ArrayList; public class Primes { /** @@ -40,10 +40,10 @@ public static int SumPrimes(int n) { * Finds all primes factors of a number * * @param n The number to find the prime factors of. - * @return An vector of all prime factors of n. + * @return An array list of all prime factors of n. */ - public static Vector PrimeFactors(int n) { - Vector ret = new Vector(); + public static ArrayList PrimeFactors(int n) { + ArrayList ret = new ArrayList(); for (int i = 2; i * i <= n; i++) { // Optimized loop condition while (n % i == 0 && IsPrime(i)) { // Optimized to handle repeated factors @@ -56,4 +56,4 @@ public static Vector PrimeFactors(int n) { } return ret; } -} +} \ No newline at end of file