From 768dc0c761798fe2d9362451f770e63f6c7e6a6d Mon Sep 17 00:00:00 2001 From: Mattrixwv Date: Wed, 17 Jun 2020 17:27:08 -0400 Subject: [PATCH] Updated for performance --- src/main/java/mattrixwv/Algorithms.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/mattrixwv/Algorithms.java b/src/main/java/mattrixwv/Algorithms.java index 841d99d..9531b3c 100644 --- a/src/main/java/mattrixwv/Algorithms.java +++ b/src/main/java/mattrixwv/Algorithms.java @@ -820,8 +820,7 @@ public class Algorithms{ } //If there are more possible recurses, recurse with the current permutation else{ - ArrayList temp = new ArrayList(); - temp = getPermutations(master, num + 1); + ArrayList temp = getPermutations(master, num + 1); perms.addAll(temp); //You need to swap the current letter with every possible letter after it //The ones needed to swap before will happen automatically when the function recurses