From 63d106afc2a78a27fb9e4374c243ceb870953136 Mon Sep 17 00:00:00 2001 From: thefluffyoshi <54290315+thefluffyoshi@users.noreply.github.com> Date: Fri, 30 Oct 2020 23:04:48 -0700 Subject: [PATCH 01/12] Add @thefluffyoshi as a contributor --- .all-contributorsrc | 9 ++++++ .idea/.gitignore | 2 ++ .idea/misc.xml | 6 ++++ .idea/modules.xml | 41 +++++++++++++++++++++++++ BONUS/Arrays/Arrays.iml | 17 ++++++++++ BONUS/Misc/Misc.iml | 18 +++++++++++ BONUS/Recursion/Recursion.iml | 19 ++++++++++++ BONUS/Strings/Strings.iml | 11 +++++++ CONTRIBUTORS.md | 1 + Day1/Day1.iml | 11 +++++++ Day2/Day2.iml | 11 +++++++ Day2/Java/Palindrome_thefluffyoshi.java | 4 +++ Day3/Day3.iml | 11 +++++++ day10/day10.iml | 11 +++++++ day11/day11.iml | 11 +++++++ day12/day12.iml | 11 +++++++ day13/day13.iml | 11 +++++++ day14/day14.iml | 11 +++++++ day15/day15.iml | 11 +++++++ day16/day16.iml | 11 +++++++ day17/day17.iml | 11 +++++++ day18/day18.iml | 11 +++++++ day19/day19.iml | 11 +++++++ day20/day20.iml | 11 +++++++ day22/day22.iml | 11 +++++++ day24/day24.iml | 11 +++++++ day25/day25.iml | 11 +++++++ day28/day28.iml | 11 +++++++ day29/day29.iml | 11 +++++++ day30/day30.iml | 11 +++++++ day31/day31.iml | 11 +++++++ day32/day32.iml | 11 +++++++ day33/day33.iml | 11 +++++++ day38/day38.iml | 11 +++++++ day4/day4.iml | 11 +++++++ day5/day5.iml | 11 +++++++ day6/day6.iml | 11 +++++++ day7/day7.iml | 11 +++++++ day8/day8.iml | 11 +++++++ day9/day9.iml | 11 +++++++ 40 files changed, 458 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 BONUS/Arrays/Arrays.iml create mode 100644 BONUS/Misc/Misc.iml create mode 100644 BONUS/Recursion/Recursion.iml create mode 100644 BONUS/Strings/Strings.iml create mode 100644 Day1/Day1.iml create mode 100644 Day2/Day2.iml create mode 100644 Day2/Java/Palindrome_thefluffyoshi.java create mode 100644 Day3/Day3.iml create mode 100644 day10/day10.iml create mode 100644 day11/day11.iml create mode 100644 day12/day12.iml create mode 100644 day13/day13.iml create mode 100644 day14/day14.iml create mode 100644 day15/day15.iml create mode 100644 day16/day16.iml create mode 100644 day17/day17.iml create mode 100644 day18/day18.iml create mode 100644 day19/day19.iml create mode 100644 day20/day20.iml create mode 100644 day22/day22.iml create mode 100644 day24/day24.iml create mode 100644 day25/day25.iml create mode 100644 day28/day28.iml create mode 100644 day29/day29.iml create mode 100644 day30/day30.iml create mode 100644 day31/day31.iml create mode 100644 day32/day32.iml create mode 100644 day33/day33.iml create mode 100644 day38/day38.iml create mode 100644 day4/day4.iml create mode 100644 day5/day5.iml create mode 100644 day6/day6.iml create mode 100644 day7/day7.iml create mode 100644 day8/day8.iml create mode 100644 day9/day9.iml diff --git a/.all-contributorsrc b/.all-contributorsrc index 4342ac5d..19c4e069 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -328,6 +328,15 @@ "doc", "code" ] + }, + { + "login": "thefluffyoshi", + "name": "Katie", + "avatar_url": "https://avatars0.githubusercontent.com/u/54290315?v=4", + "profile": "https://github.com/thefluffyoshi", + "contributions": [ + "code" + ] } ], "commitConvention": "none" diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..5c98b428 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..1763e153 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..1d2823b6 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BONUS/Arrays/Arrays.iml b/BONUS/Arrays/Arrays.iml new file mode 100644 index 00000000..526e649f --- /dev/null +++ b/BONUS/Arrays/Arrays.iml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BONUS/Misc/Misc.iml b/BONUS/Misc/Misc.iml new file mode 100644 index 00000000..15b04d77 --- /dev/null +++ b/BONUS/Misc/Misc.iml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BONUS/Recursion/Recursion.iml b/BONUS/Recursion/Recursion.iml new file mode 100644 index 00000000..e3ffe152 --- /dev/null +++ b/BONUS/Recursion/Recursion.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BONUS/Strings/Strings.iml b/BONUS/Strings/Strings.iml new file mode 100644 index 00000000..4c73fede --- /dev/null +++ b/BONUS/Strings/Strings.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 39699d08..d9a9dcc5 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -49,6 +49,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
GAURAV KUMAR

📖 💻
wboccard

📖 💻
d-l-mcbride

📖 💻 +
Katie

💻 diff --git a/Day1/Day1.iml b/Day1/Day1.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/Day1/Day1.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Day2/Day2.iml b/Day2/Day2.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/Day2/Day2.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Day2/Java/Palindrome_thefluffyoshi.java b/Day2/Java/Palindrome_thefluffyoshi.java new file mode 100644 index 00000000..9c2f9bd5 --- /dev/null +++ b/Day2/Java/Palindrome_thefluffyoshi.java @@ -0,0 +1,4 @@ +package PACKAGE_NAME; + +public class Palindrome_thefluffyoshi { +} diff --git a/Day3/Day3.iml b/Day3/Day3.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/Day3/Day3.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day10/day10.iml b/day10/day10.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day10/day10.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day11/day11.iml b/day11/day11.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day11/day11.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day12/day12.iml b/day12/day12.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day12/day12.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day13/day13.iml b/day13/day13.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day13/day13.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day14/day14.iml b/day14/day14.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day14/day14.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day15/day15.iml b/day15/day15.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day15/day15.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day16/day16.iml b/day16/day16.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day16/day16.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day17/day17.iml b/day17/day17.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day17/day17.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day18/day18.iml b/day18/day18.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day18/day18.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day19/day19.iml b/day19/day19.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day19/day19.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day20/day20.iml b/day20/day20.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day20/day20.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day22/day22.iml b/day22/day22.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day22/day22.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day24/day24.iml b/day24/day24.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day24/day24.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day25/day25.iml b/day25/day25.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day25/day25.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day28/day28.iml b/day28/day28.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day28/day28.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day29/day29.iml b/day29/day29.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day29/day29.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day30/day30.iml b/day30/day30.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day30/day30.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day31/day31.iml b/day31/day31.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day31/day31.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day32/day32.iml b/day32/day32.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day32/day32.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day33/day33.iml b/day33/day33.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day33/day33.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day38/day38.iml b/day38/day38.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day38/day38.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day4/day4.iml b/day4/day4.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day4/day4.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day5/day5.iml b/day5/day5.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day5/day5.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day6/day6.iml b/day6/day6.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day6/day6.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day7/day7.iml b/day7/day7.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day7/day7.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day8/day8.iml b/day8/day8.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day8/day8.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day9/day9.iml b/day9/day9.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day9/day9.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file From 7e187dda88f172b2f15b1b39502b0512ce4efdb4 Mon Sep 17 00:00:00 2001 From: thefluffyoshi <54290315+thefluffyoshi@users.noreply.github.com> Date: Fri, 30 Oct 2020 23:07:03 -0700 Subject: [PATCH 02/12] added thefluffyoshi Palindrome version --- Day2/Java/Palindrome_thefluffyoshi.java | 39 ++++++++++++++++++++++-- Day2/README.md | 40 +++++++++++++++++++++++++ package-lock.json | 6 ++-- 3 files changed, 79 insertions(+), 6 deletions(-) diff --git a/Day2/Java/Palindrome_thefluffyoshi.java b/Day2/Java/Palindrome_thefluffyoshi.java index 9c2f9bd5..049de6f4 100644 --- a/Day2/Java/Palindrome_thefluffyoshi.java +++ b/Day2/Java/Palindrome_thefluffyoshi.java @@ -1,4 +1,37 @@ -package PACKAGE_NAME; +/* + * @author thefluffyoshi + * date: 30/10/2020 + */ -public class Palindrome_thefluffyoshi { -} +import java.util.Scanner; + +public class Palindrome_thefluffyoshi +{ + public static void main (String[] args) + { + //Instantiating variables + String str_reverse = ""; + + //Inputted word + System.out.print("Please input the word you want to check: "); + Scanner input = new Scanner(System.in); + String str = input.next(); + + //Reversing the inputted word + for (int i = str.length() - 1; i >= 0; i--) + { + str_reverse = str_reverse + str.charAt(i); + }//end for loop reversal + + //Checking if inputted word is a Palindrome + if (str_reverse.equals(str)) + { + System.out.println("true"); + } + else + { + System.out.println("false"); + } + + }//end main +}//end public class \ No newline at end of file diff --git a/Day2/README.md b/Day2/README.md index c0743faf..dcb48365 100644 --- a/Day2/README.md +++ b/Day2/README.md @@ -328,6 +328,46 @@ class PalindromeCheckTest { } ``` +### [Solution by @thefluffyoshi](./Java/Palindrome_thefluffyoshi.java) +``` +/* + * @author thefluffyoshi + * date: 30/10/2020 + */ + +import java.util.Scanner; + +public class Palindrome_yoshi +{ + public static void main (String[] args) + { + //Instantiating variables + String str_reverse = ""; + + //Inputted word + System.out.print("Please input the word you want to check: "); + Scanner input = new Scanner(System.in); + String str = input.next(); + + //Reversing the inputted word + for (int i = str.length() - 1; i >= 0; i--) + { + str_reverse = str_reverse + str.charAt(i); + }//end for loop reversal + + //Checking if inputted word is a Palindrome + if (str_reverse.equals(str)) + { + System.out.println("true"); + } + else + { + System.out.println("false"); + } + + }//end main +}//end public class +``` ## C++ Implementation diff --git a/package-lock.json b/package-lock.json index fa1db3fe..5f56ff71 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "@babel/runtime": { - "version": "7.11.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.11.2.tgz", - "integrity": "sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw==", + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz", + "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==", "dev": true, "requires": { "regenerator-runtime": "^0.13.4" From 0c54a6cac09010af996ed728f8d2822c72fff38a Mon Sep 17 00:00:00 2001 From: thefluffyoshi <54290315+thefluffyoshi@users.noreply.github.com> Date: Sat, 31 Oct 2020 16:31:45 -0700 Subject: [PATCH 03/12] added thefluffyoshi linear search version --- day28/Java/linearSearch_thefluffyoshi.java | 50 ++++++++++++++++++++ day28/README.md | 55 ++++++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 day28/Java/linearSearch_thefluffyoshi.java diff --git a/day28/Java/linearSearch_thefluffyoshi.java b/day28/Java/linearSearch_thefluffyoshi.java new file mode 100644 index 00000000..acd75bba --- /dev/null +++ b/day28/Java/linearSearch_thefluffyoshi.java @@ -0,0 +1,50 @@ +/* + * @author thefluffyoshi + * date: 31/10/2020 + */ + +import java.util.Scanner; + +public class linearSearch_thefluffyoshi +{ + public static void main(String []args) + { + int arr_size, i, searchnum, storeNum = -2; + + //Array size + System.out.print("Enter an array size: "); + Scanner arr_scan = new Scanner(System.in); + arr_size = arr_scan.nextInt(); + + int array[] = new int[arr_size]; + + //Putting in the array elements + for (i = 0; i < arr_size; i++) + { + System.out.print("Enter the elements inside the array: "); + array[i] = arr_scan.nextInt(); + } + + //Specific element/number to be found in the array + System.out.print("Enter element to be found: "); + searchnum = arr_scan.nextInt(); + for (i = 0; i < arr_size; i++) + { + if (array[i] == searchnum) + { + storeNum = i; + break; + } + } + + //Confirmation if specific element is inside array or not and at what position instead of index + if (storeNum != -2) + { + System.out.println("Output at position: " + storeNum + 1); + } + else + { + System.out.println("Output: undefined"); + } + } +} diff --git a/day28/README.md b/day28/README.md index 5d266d6b..a7a91ce2 100644 --- a/day28/README.md +++ b/day28/README.md @@ -75,6 +75,61 @@ public class linearSearch1 { } ``` +### [Solution by thefluffyoshi](./Java/linearSearch_thefluffyoshi.java) +``` +/* + * @author thefluffyoshi + * date: 31/10/2020 + */ + +import java.util.Scanner; + +public class linearSearch_thefluffyoshi +{ + public static void main(String []args) + { + int arr_size, i, searchnum, storeNum = -2; + + //Array size + System.out.print("Enter an array size: "); + Scanner arr_scan = new Scanner(System.in); + arr_size = arr_scan.nextInt(); + + int array[] = new int[arr_size]; + + //Putting in the array elements + for (i = 0; i < arr_size; i++) + { + System.out.print("Enter the elements inside the array: "); + array[i] = arr_scan.nextInt(); + } + + //Specific element/number to be found in the array + System.out.print("Enter element to be found: "); + searchnum = arr_scan.nextInt(); + for (i = 0; i < arr_size; i++) + { + if (array[i] == searchnum) + { + storeNum = i; + break; + } + } + + //Confirmation if specific element is inside array or not and at what position instead of index + if (storeNum != -2) + { + System.out.println("Output at position: " + storeNum + 1); + } + else + { + System.out.println("Output: undefined"); + } + } +} + +``` + ## C++ Implementation ### [Solution](./C++/linearSearch.cpp) From 566ce5459d235562802e2067bfb26c7815f3d5cf Mon Sep 17 00:00:00 2001 From: thefluffyoshi <54290315+thefluffyoshi@users.noreply.github.com> Date: Sat, 31 Oct 2020 17:08:29 -0700 Subject: [PATCH 04/12] added thefluffyoshi bubble sort version --- day31/Java/bubbleSort_thefluffyoshi.java | 49 ++++++++++++++++++++++ day31/README.md | 53 ++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 day31/Java/bubbleSort_thefluffyoshi.java diff --git a/day31/Java/bubbleSort_thefluffyoshi.java b/day31/Java/bubbleSort_thefluffyoshi.java new file mode 100644 index 00000000..a48836ec --- /dev/null +++ b/day31/Java/bubbleSort_thefluffyoshi.java @@ -0,0 +1,49 @@ +/* + * @author thefluffyoshi + * date: 31/10/2020 + */ + +import java.util.Scanner; + +public class bubbleSort_thefluffyoshi +{ + public static void main (String[] args) + { + int arr_size, i, j, swapNum; + + //Enter how big the array is + System.out.print("Enter an array size: "); + Scanner arr_scan = new Scanner(System.in); + arr_size = arr_scan.nextInt(); + + int array[] = new int[arr_size]; + + //The array numbers + for (i = 0; i < arr_size; i++) + { + System.out.print("Enter the elements inside the array: "); + array[i] = arr_scan.nextInt(); + }//end for loop + + //Bubble sort + for (i = 0; i < arr_size-1; i++) + { + for (j = 0; j < arr_size-i-1; j++) + { + if (array[j] > array[j+1]) + { + swapNum = array[j]; + array[j] = array[j+1]; + array[j+1] = swapNum; + } + } + } + + //End sort + System.out.print("Sorted array: "); + for (i = 0; i < arr_size; i++) + { + System.out.print(array[i] + " "); + } + }//end main +}//end class \ No newline at end of file diff --git a/day31/README.md b/day31/README.md index 4c701504..2774c316 100644 --- a/day31/README.md +++ b/day31/README.md @@ -66,6 +66,59 @@ public class bubbleSort { } ``` +### [Solution by thefluffyoshi](./Java/bubbleSort_thefluffyoshi.java) +``` +/* + * @author thefluffyoshi + * date: 31/10/2020 + */ + +import java.util.Scanner; + +public class bubbleSort_thefluffyoshi +{ + public static void main (String[] args) + { + int arr_size, i, j, swapNum; + + //Enter how big the array is + System.out.print("Enter an array size: "); + Scanner arr_scan = new Scanner(System.in); + arr_size = arr_scan.nextInt(); + + int array[] = new int[arr_size]; + + //The array numbers + for (i = 0; i < arr_size; i++) + { + System.out.print("Enter the elements inside the array: "); + array[i] = arr_scan.nextInt(); + }//end for loop + + //Bubble sort + for (i = 0; i < arr_size-1; i++) + { + for (j = 0; j < arr_size-i-1; j++) + { + if (array[j] > array[j+1]) + { + swapNum = array[j]; + array[j] = array[j+1]; + array[j+1] = swapNum; + } + } + } + + //End sort + System.out.print("Sorted array: "); + for (i = 0; i < arr_size; i++) + { + System.out.print(array[i] + " "); + } + }//end main +}//end class +``` + ### [C++ Implementation](./C++/bubbleSort.cpp) ```cpp From fc72a0989b5424994ca24439b45bb6b233b66921 Mon Sep 17 00:00:00 2001 From: thefluffyoshi <54290315+thefluffyoshi@users.noreply.github.com> Date: Sat, 31 Oct 2020 17:23:10 -0700 Subject: [PATCH 05/12] added thefluffyoshi Fizzbuzz version --- Day1/Java/FizzBuzz_thefluffyoshi.java | 33 ++++++++++++++++++++++++ Day1/README.md | 37 +++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 Day1/Java/FizzBuzz_thefluffyoshi.java diff --git a/Day1/Java/FizzBuzz_thefluffyoshi.java b/Day1/Java/FizzBuzz_thefluffyoshi.java new file mode 100644 index 00000000..b8d2adac --- /dev/null +++ b/Day1/Java/FizzBuzz_thefluffyoshi.java @@ -0,0 +1,33 @@ +/* + * @author thefluffyoshi + * date: 31/10/2020 + */ + +import java.util.Scanner; + +public class FizzBuzz_thefluffyoshi +{ + public static void main (String[] args) + { + int num, i; + System.out.print("Enter a number: "); + Scanner scan = new Scanner(System.in); + num = scan.nextInt(); + + for (i = 1; i < num; i++) + { + if (i%15 == 0) + { + System.out.print("Fizzbuzz" + " "); + } + else if (i%5 == 0) + { + System.out.print("Buzz" + " "); + } + else if (i%3 == 0) + { + System.out.print("Fizz" + " "); + } + } + } +} \ No newline at end of file diff --git a/Day1/README.md b/Day1/README.md index 7ddf0e28..84a3bafe 100644 --- a/Day1/README.md +++ b/Day1/README.md @@ -180,6 +180,43 @@ public class FizzBuzz_wb { } ``` +### [Solution 4](./Java/FizzBuzz_thefluffyoshi.java) +```java +/* + * @author thefluffyoshi + * date: 31/10/2020 + */ + +import java.util.Scanner; + +public class FizzBuzz_thefluffyoshi +{ + public static void main (String[] args) + { + int num, i; + System.out.print("Enter a number: "); + Scanner scan = new Scanner(System.in); + num = scan.nextInt(); + + for (i = 1; i < num; i++) + { + if (i%15 == 0) + { + System.out.print("Fizzbuzz" + " "); + } + else if (i%5 == 0) + { + System.out.print("Buzz" + " "); + } + else if (i%3 == 0) + { + System.out.print("Fizz" + " "); + } + } + } +} +``` + ## C Implementation ### [Fizzbuzz.c](./C/fizzbuzz.c) From ed46567825d82b00601078bb2fb8018946644ea5 Mon Sep 17 00:00:00 2001 From: Katie <54290315+thefluffyoshi@users.noreply.github.com> Date: Sun, 1 Nov 2020 10:50:15 -0800 Subject: [PATCH 06/12] Deleted .gitignore --- .idea/.gitignore | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .idea/.gitignore diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 5c98b428..00000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Default ignored files -/workspace.xml \ No newline at end of file From f3c1b41992a7a8c93668d4d745f1fc8fb6e77506 Mon Sep 17 00:00:00 2001 From: Katie <54290315+thefluffyoshi@users.noreply.github.com> Date: Sun, 1 Nov 2020 10:50:39 -0800 Subject: [PATCH 07/12] Deleted misc.xml --- .idea/misc.xml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .idea/misc.xml diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 1763e153..00000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 7e9c65c0c866b1bed29cc442e4b68409c7284fe0 Mon Sep 17 00:00:00 2001 From: Katie <54290315+thefluffyoshi@users.noreply.github.com> Date: Sun, 1 Nov 2020 10:51:03 -0800 Subject: [PATCH 08/12] Deleted modules.xml --- .idea/modules.xml | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 .idea/modules.xml diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 1d2823b6..00000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 0154a08ec84f1379ecb9511ae0c6549aaff6a688 Mon Sep 17 00:00:00 2001 From: thefluffyoshi <54290315+thefluffyoshi@users.noreply.github.com> Date: Sun, 1 Nov 2020 11:06:50 -0800 Subject: [PATCH 09/12] added thefluffyoshi Day 1 Fizzbuzz version --- Day1/Java/FizzBuzz_thefluffyoshi.java | 19 +++++++++++++------ Day1/README.md | 21 ++++++++++++++------- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/Day1/Java/FizzBuzz_thefluffyoshi.java b/Day1/Java/FizzBuzz_thefluffyoshi.java index b8d2adac..4e6f3f91 100644 --- a/Day1/Java/FizzBuzz_thefluffyoshi.java +++ b/Day1/Java/FizzBuzz_thefluffyoshi.java @@ -9,25 +9,32 @@ public class FizzBuzz_thefluffyoshi { public static void main (String[] args) { + //Variables int num, i; + + //Input a num System.out.print("Enter a number: "); Scanner scan = new Scanner(System.in); num = scan.nextInt(); + //Checking inputted num for (i = 1; i < num; i++) { + //Checking if num is divisible by both 5 and 3 if (i%15 == 0) { System.out.print("Fizzbuzz" + " "); - } + }//end FizzBuzz if + //Checking if num is divisible by 5 else if (i%5 == 0) { System.out.print("Buzz" + " "); - } + }//end Buzz else if + //Checking if num is divisible by 3 else if (i%3 == 0) { System.out.print("Fizz" + " "); - } - } - } -} \ No newline at end of file + }//end Fizz if + }//end for loop checking + }//end main +}//end class FizzBuzz \ No newline at end of file diff --git a/Day1/README.md b/Day1/README.md index 84a3bafe..d048f756 100644 --- a/Day1/README.md +++ b/Day1/README.md @@ -193,28 +193,35 @@ public class FizzBuzz_thefluffyoshi { public static void main (String[] args) { + //Variables int num, i; + + //Input a num System.out.print("Enter a number: "); Scanner scan = new Scanner(System.in); num = scan.nextInt(); - + + //Checking inputted num for (i = 1; i < num; i++) { + //Checking if num is divisible by both 5 and 3 if (i%15 == 0) { System.out.print("Fizzbuzz" + " "); - } + }//end FizzBuzz if + //Checking if num is divisible by 5 else if (i%5 == 0) { System.out.print("Buzz" + " "); - } + }//end Buzz else if + //Checking if num is divisible by 3 else if (i%3 == 0) { System.out.print("Fizz" + " "); - } - } - } -} + }//end Fizz if + }//end for loop checking + }//end main +}//end class FizzBuzz ``` ## C Implementation From 2ed2fb0e8b9d672776eb6f1da350446cb70851cc Mon Sep 17 00:00:00 2001 From: thefluffyoshi <54290315+thefluffyoshi@users.noreply.github.com> Date: Sun, 1 Nov 2020 11:09:38 -0800 Subject: [PATCH 10/12] added thefluffyoshi Day 2 Palindrome version --- Day2/Java/Palindrome_thefluffyoshi.java | 6 +++--- Day2/README.md | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Day2/Java/Palindrome_thefluffyoshi.java b/Day2/Java/Palindrome_thefluffyoshi.java index 049de6f4..e09d7122 100644 --- a/Day2/Java/Palindrome_thefluffyoshi.java +++ b/Day2/Java/Palindrome_thefluffyoshi.java @@ -12,7 +12,7 @@ public static void main (String[] args) //Instantiating variables String str_reverse = ""; - //Inputted word + //Input word System.out.print("Please input the word you want to check: "); Scanner input = new Scanner(System.in); String str = input.next(); @@ -23,7 +23,7 @@ public static void main (String[] args) str_reverse = str_reverse + str.charAt(i); }//end for loop reversal - //Checking if inputted word is a Palindrome + //Checking if inputted word is equal/the same as the reverse if (str_reverse.equals(str)) { System.out.println("true"); @@ -34,4 +34,4 @@ public static void main (String[] args) } }//end main -}//end public class \ No newline at end of file +}//end Palindrome class \ No newline at end of file diff --git a/Day2/README.md b/Day2/README.md index dcb48365..16718113 100644 --- a/Day2/README.md +++ b/Day2/README.md @@ -329,7 +329,7 @@ class PalindromeCheckTest { ``` ### [Solution by @thefluffyoshi](./Java/Palindrome_thefluffyoshi.java) -``` +```java /* * @author thefluffyoshi * date: 30/10/2020 @@ -337,14 +337,14 @@ class PalindromeCheckTest { import java.util.Scanner; -public class Palindrome_yoshi +public class Palindrome_thefluffyoshi { public static void main (String[] args) { //Instantiating variables String str_reverse = ""; - //Inputted word + //Input word System.out.print("Please input the word you want to check: "); Scanner input = new Scanner(System.in); String str = input.next(); @@ -355,7 +355,7 @@ public class Palindrome_yoshi str_reverse = str_reverse + str.charAt(i); }//end for loop reversal - //Checking if inputted word is a Palindrome + //Checking if inputted word is equal/the same as the reverse if (str_reverse.equals(str)) { System.out.println("true"); @@ -366,7 +366,7 @@ public class Palindrome_yoshi } }//end main -}//end public class +}//end Palindrome class ``` From b815fef817cb0eb2abd36292b15f1f9100a3cb7f Mon Sep 17 00:00:00 2001 From: thefluffyoshi <54290315+thefluffyoshi@users.noreply.github.com> Date: Sun, 1 Nov 2020 11:54:52 -0800 Subject: [PATCH 11/12] added thefluffyoshi Day 28 linearSearch version --- day28/Java/linearSearch_thefluffyoshi.java | 18 ++++++++++-------- day28/README.md | 21 ++++++++++++--------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/day28/Java/linearSearch_thefluffyoshi.java b/day28/Java/linearSearch_thefluffyoshi.java index acd75bba..fb0d68dc 100644 --- a/day28/Java/linearSearch_thefluffyoshi.java +++ b/day28/Java/linearSearch_thefluffyoshi.java @@ -9,6 +9,7 @@ public class linearSearch_thefluffyoshi { public static void main(String []args) { + //vars int arr_size, i, searchnum, storeNum = -2; //Array size @@ -16,14 +17,15 @@ public static void main(String []args) Scanner arr_scan = new Scanner(System.in); arr_size = arr_scan.nextInt(); + //Storing the size into an array int array[] = new int[arr_size]; - //Putting in the array elements + //Putting in the array elements based on the size of the array for (i = 0; i < arr_size; i++) { System.out.print("Enter the elements inside the array: "); array[i] = arr_scan.nextInt(); - } + }//end input elements inside array //Specific element/number to be found in the array System.out.print("Enter element to be found: "); @@ -34,17 +36,17 @@ public static void main(String []args) { storeNum = i; break; - } - } + }//end searching for specific num + }//end for loop to search //Confirmation if specific element is inside array or not and at what position instead of index if (storeNum != -2) { System.out.println("Output at position: " + storeNum + 1); - } + }//end comparing if storeNum was changed else { System.out.println("Output: undefined"); - } - } -} + }//end if storeNum stayed the same + }//end main +}//end linearSearch class diff --git a/day28/README.md b/day28/README.md index a7a91ce2..598e140c 100644 --- a/day28/README.md +++ b/day28/README.md @@ -76,7 +76,7 @@ public class linearSearch1 { ``` ### [Solution by thefluffyoshi](./Java/linearSearch_thefluffyoshi.java) -``` +```java /* * @author thefluffyoshi * date: 31/10/2020 @@ -88,6 +88,7 @@ public class linearSearch_thefluffyoshi { public static void main(String []args) { + //vars int arr_size, i, searchnum, storeNum = -2; //Array size @@ -95,14 +96,15 @@ public class linearSearch_thefluffyoshi Scanner arr_scan = new Scanner(System.in); arr_size = arr_scan.nextInt(); + //Storing the size into an array int array[] = new int[arr_size]; - //Putting in the array elements + //Putting in the array elements based on the size of the array for (i = 0; i < arr_size; i++) { System.out.print("Enter the elements inside the array: "); array[i] = arr_scan.nextInt(); - } + }//end input elements inside array //Specific element/number to be found in the array System.out.print("Enter element to be found: "); @@ -113,20 +115,21 @@ public class linearSearch_thefluffyoshi { storeNum = i; break; - } - } + }//end searching for specific num + }//end for loop to search //Confirmation if specific element is inside array or not and at what position instead of index if (storeNum != -2) { System.out.println("Output at position: " + storeNum + 1); - } + }//end comparing if storeNum was changed else { System.out.println("Output: undefined"); - } - } -} + }//end if storeNum stayed the same + }//end main +}//end linearSearch class + ``` From b754348e3629cee51ef6eff67060da8c234925a1 Mon Sep 17 00:00:00 2001 From: thefluffyoshi <54290315+thefluffyoshi@users.noreply.github.com> Date: Sun, 1 Nov 2020 12:01:08 -0800 Subject: [PATCH 12/12] added thefluffyoshi Day 31 linearSearch version --- day31/Java/bubbleSort_thefluffyoshi.java | 13 +++++++------ day31/README.md | 17 +++++++++-------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/day31/Java/bubbleSort_thefluffyoshi.java b/day31/Java/bubbleSort_thefluffyoshi.java index a48836ec..1364daf5 100644 --- a/day31/Java/bubbleSort_thefluffyoshi.java +++ b/day31/Java/bubbleSort_thefluffyoshi.java @@ -9,6 +9,7 @@ public class bubbleSort_thefluffyoshi { public static void main (String[] args) { + //Vars int arr_size, i, j, swapNum; //Enter how big the array is @@ -18,12 +19,12 @@ public static void main (String[] args) int array[] = new int[arr_size]; - //The array numbers + //Input the array numbers/elements for (i = 0; i < arr_size; i++) { System.out.print("Enter the elements inside the array: "); array[i] = arr_scan.nextInt(); - }//end for loop + }//end for loop to input elements //Bubble sort for (i = 0; i < arr_size-1; i++) @@ -35,15 +36,15 @@ public static void main (String[] args) swapNum = array[j]; array[j] = array[j+1]; array[j+1] = swapNum; - } - } - } + }//end if to swap + }//end nested for loop + }//end for loop to sort //End sort System.out.print("Sorted array: "); for (i = 0; i < arr_size; i++) { System.out.print(array[i] + " "); - } + }//end for loop to print out the sorted array }//end main }//end class \ No newline at end of file diff --git a/day31/README.md b/day31/README.md index 2774c316..1e4cb22c 100644 --- a/day31/README.md +++ b/day31/README.md @@ -67,7 +67,7 @@ public class bubbleSort { ``` ### [Solution by thefluffyoshi](./Java/bubbleSort_thefluffyoshi.java) -``` +```Java /* * @author thefluffyoshi * date: 31/10/2020 @@ -79,6 +79,7 @@ public class bubbleSort_thefluffyoshi { public static void main (String[] args) { + //Vars int arr_size, i, j, swapNum; //Enter how big the array is @@ -88,12 +89,12 @@ public class bubbleSort_thefluffyoshi int array[] = new int[arr_size]; - //The array numbers + //Input the array numbers/elements for (i = 0; i < arr_size; i++) { System.out.print("Enter the elements inside the array: "); array[i] = arr_scan.nextInt(); - }//end for loop + }//end for loop to input elements //Bubble sort for (i = 0; i < arr_size-1; i++) @@ -105,16 +106,16 @@ public class bubbleSort_thefluffyoshi swapNum = array[j]; array[j] = array[j+1]; array[j+1] = swapNum; - } - } - } - + }//end if to swap + }//end nested for loop + }//end for loop to sort + //End sort System.out.print("Sorted array: "); for (i = 0; i < arr_size; i++) { System.out.print(array[i] + " "); - } + }//end for loop to print out the sorted array }//end main }//end class ```