From d709a920cfaaa24864538bea7629634070522c9f Mon Sep 17 00:00:00 2001 From: Caleb Fontenot Date: Wed, 30 Aug 2023 13:30:56 -0500 Subject: [PATCH] that's it for today --- Semester 3/Assignments/RecursionDemo/pom.xml | 14 +++ .../caleb/recursiondemo/RecursionDemo.java | 84 ++++++++++++++++++ .../target/RecursionDemo-1.0-SNAPSHOT.jar | Bin 0 -> 3705 bytes .../caleb/recursiondemo/RecursionDemo.class | Bin 0 -> 2702 bytes .../target/maven-archiver/pom.properties | 3 + .../compile/default-compile/createdFiles.lst | 1 + .../compile/default-compile/inputFiles.lst | 1 + .../default-testCompile/createdFiles.lst | 0 .../default-testCompile/inputFiles.lst | 0 9 files changed, 103 insertions(+) create mode 100644 Semester 3/Assignments/RecursionDemo/pom.xml create mode 100644 Semester 3/Assignments/RecursionDemo/src/main/java/edu/slcc/asdv/caleb/recursiondemo/RecursionDemo.java create mode 100644 Semester 3/Assignments/RecursionDemo/target/RecursionDemo-1.0-SNAPSHOT.jar create mode 100644 Semester 3/Assignments/RecursionDemo/target/classes/edu/slcc/asdv/caleb/recursiondemo/RecursionDemo.class create mode 100644 Semester 3/Assignments/RecursionDemo/target/maven-archiver/pom.properties create mode 100644 Semester 3/Assignments/RecursionDemo/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst create mode 100644 Semester 3/Assignments/RecursionDemo/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst create mode 100644 Semester 3/Assignments/RecursionDemo/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst create mode 100644 Semester 3/Assignments/RecursionDemo/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst diff --git a/Semester 3/Assignments/RecursionDemo/pom.xml b/Semester 3/Assignments/RecursionDemo/pom.xml new file mode 100644 index 0000000..4f49854 --- /dev/null +++ b/Semester 3/Assignments/RecursionDemo/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + edu.slcc.asdv.caleb + RecursionDemo + 1.0-SNAPSHOT + jar + + UTF-8 + 20 + 20 + edu.slcc.asdv.caleb.recursiondemo.RecursionDemo + + \ No newline at end of file diff --git a/Semester 3/Assignments/RecursionDemo/src/main/java/edu/slcc/asdv/caleb/recursiondemo/RecursionDemo.java b/Semester 3/Assignments/RecursionDemo/src/main/java/edu/slcc/asdv/caleb/recursiondemo/RecursionDemo.java new file mode 100644 index 0000000..352c17a --- /dev/null +++ b/Semester 3/Assignments/RecursionDemo/src/main/java/edu/slcc/asdv/caleb/recursiondemo/RecursionDemo.java @@ -0,0 +1,84 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + */ +package edu.slcc.asdv.caleb.recursiondemo; + +/** + * + * @author caleb + */ +public class RecursionDemo { + + static void printNTimes(int nTimes, String message) + { + for (int i = 0; i < nTimes; ++i) { + System.out.println(message); + } + } + + public static boolean isPalendrome(String s) + { + String backwards = ""; + for (int i = s.length() - 1; i >= 0; i--) { + backwards += s.charAt(i); + } + return s.equals(backwards); + } + + public static long fib(int n) + { + if (n == 1 || n == 2) { + return 1; + } + System.out.println(n); + return fib(n - 1) + fib(n - 2); + } + + static void printNTimesRecursion(int nTimes, String message) + { + if (nTimes == 0) { + return; + } + System.out.println(message); + printNTimesRecursion(--nTimes, message); + } + + public static boolean isPalendromeRecursion(String s) { + if (s.length() == 0 || s.length() == 1) { + return true; + } else if (s.charAt(0) != s.charAt(s.length() - 1)) { + return false; + } + return isPalendromeRecursion(s.substring(1, s.length() - 1)); + } + + public static long factorial(int n) + { + long fact; + if (n == 1) { + return 1; + } + fact = n * factorial(n - 1); + return fact; + } + + public static void printArrayRecursively(int[] arr, int index) { + if (index == arr.length) { + return; + } else { + System.out.print(arr[index] + " "); + printArrayRecursively(arr, index+1); + } + } + + public static void main(String[] args) + { + System.out.println(factorial(20)); + printNTimesRecursion(1, "Hello Recursion"); + //System.out.println(fib(10)); + System.out.println(isPalendrome("detartrated")); + System.out.println(isPalendromeRecursion("detartrated")); + int[] arr = {2, 3, 5, 6, 7, 8, 10, 32, 64, 128}; + printArrayRecursively(arr, 0); + } +} diff --git a/Semester 3/Assignments/RecursionDemo/target/RecursionDemo-1.0-SNAPSHOT.jar b/Semester 3/Assignments/RecursionDemo/target/RecursionDemo-1.0-SNAPSHOT.jar new file mode 100644 index 0000000000000000000000000000000000000000..c1fdbd27d8a5bd2bf7577b90b480f573bc2fcc29 GIT binary patch literal 3705 zcmbW42{e>#8^>pCQTSRYOT1L5!C;6%ugE^rgc+3VW}YHrnMLSTc4Zr~REn}|L!<@e zD@&3kTUkQZh7dE>XnAK+SzbDw?m5pn_nEo=|LeN%>v`_yH^xX-w)G$oCkVviEP5EU zWNk4>K1LYlx3J!fj#6XB&nAqE@$F(5O6!oJo-W1|iqe}v)l?ru z%0e4>kg|}vnwNLc^396f14JkSC1Z$c@VHrk9!JR_Ycb0dM=kcw^)gzcoVMdVfSnMytc$bFR zlW-@05zAcmPs?wySbIF+@C(I`H55bu>p>(rxw+y17q=z)mHqf1L;tfMF7_t@*Ixwh z{BJO$S}1b^pv-EaE2~|ZP2u+p&_9aT`BD7BUBc`USGxFvtLz|945KM~e{1o}+@M&z zJ&6==Zi(U3=lgQX?XJwu+Z_?oCXdP-j>zp&*ukM2+FhEuk=xGUl&8KxLg&*23+}?p zkl44;)q&%$CDlRxdvZCHkkB1ReG~ zs^cb2ZkN`K9)6MH^R3+Fhj+PF@2>Nn(D-1V(UsF@HZq{)YNJNwf;Fpl>}}N%RU?m7 zg8i-83+=euD-tJju5|5_Xo=N*$qzru`ogYd`fq+}G^Gq)3V)UqQ_vyn9p^MUeAxs? zhDa8@FvxTme5SyYJ2a?;5Ci&=dsJF?N9#*Cz zeA5_=x^`HVr|I<0o4O(FLUO_v08f1Px!y3%(_Q1~eX5O$^z~1!Qxw>(b3<}IMN0b~ zj{koG5s)Mw?6nS{YhU%;UT8&lj5|_&`y^F{>vC#Ea*~RGhRfE-JhZqoJQn6m$lBv_ z_Z%k1iD=!%?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wUY7U1_(j-ny!km!bCu(hmn(vqUm-o^#D^Ok#cOfpe#B9B4KRb7T!k@< z)7%k!WBKFaEM@)jT& zzJCx6p^KOj#KgPX!=#X?(5){Scz|#+_z=P96N-{tLw_<*Sw|)r6r=LQaVms%wb@Up z4^Zenbl_lv=zXX-iU=J7@I@uc&l}zgSE6bnr-|fG2t3^s9~;T+I!?Tl-(}oS2PtyT zFie&yIOc@udX4aYNI}x$MeoI1_2>-#Zw$Hg zc{Kq!*1`#<^dzM{#joc;1M2}#cELIbf4kH{82oB@Fm4fs$b3gK;0T=j&e8UqHhkb! zUC;9TAnR_3k|?(lToP5LV4=vc%e;SeM7tKvmkSXwB=`yR;~FdfI%S${AToz4YP7vgvVsyn h7rYI`?O|Y<&o<8PaQCh=uHp;sMY;YGU*jJ3{s*3QHBSHl literal 0 HcmV?d00001 diff --git a/Semester 3/Assignments/RecursionDemo/target/maven-archiver/pom.properties b/Semester 3/Assignments/RecursionDemo/target/maven-archiver/pom.properties new file mode 100644 index 0000000..7e807e9 --- /dev/null +++ b/Semester 3/Assignments/RecursionDemo/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=RecursionDemo +groupId=edu.slcc.asdv.caleb +version=1.0-SNAPSHOT diff --git a/Semester 3/Assignments/RecursionDemo/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/Semester 3/Assignments/RecursionDemo/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..b53fde3 --- /dev/null +++ b/Semester 3/Assignments/RecursionDemo/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1 @@ +edu/slcc/asdv/caleb/recursiondemo/RecursionDemo.class diff --git a/Semester 3/Assignments/RecursionDemo/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/Semester 3/Assignments/RecursionDemo/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..7972ded --- /dev/null +++ b/Semester 3/Assignments/RecursionDemo/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1 @@ +/home/caleb/ASDV-WebDev/Semester 2/RecursionDemo/src/main/java/edu/slcc/asdv/caleb/recursiondemo/RecursionDemo.java diff --git a/Semester 3/Assignments/RecursionDemo/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/Semester 3/Assignments/RecursionDemo/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst new file mode 100644 index 0000000..e69de29 diff --git a/Semester 3/Assignments/RecursionDemo/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/Semester 3/Assignments/RecursionDemo/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..e69de29