From ce11e4200d5ca4be394740904d54f58ff5086d0d Mon Sep 17 00:00:00 2001 From: "@2001!" <59911272+ErzaTitania-2001@users.noreply.github.com> Date: Wed, 2 Dec 2020 11:14:41 +0530 Subject: [PATCH 01/12] Add files via upload Solving the question Prime Number with iteration as well as recursion #1372 --- Java/cp/Prime.java | 18 ++++++++++++++++++ Java/cp/PrimeRecursion.java | 25 +++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 Java/cp/Prime.java create mode 100644 Java/cp/PrimeRecursion.java diff --git a/Java/cp/Prime.java b/Java/cp/Prime.java new file mode 100644 index 0000000000..b25f5a7221 --- /dev/null +++ b/Java/cp/Prime.java @@ -0,0 +1,18 @@ +//check whether a number is Prime or not without recursion// +import java.util.Scanner; +class Prime +{ + public static void main(String args[]) + { + Scanner sc=new Scanner(System.in); + System.out.print("Enter a number : "); + int n=(int)Math.abs(sc.nextInt()); + int c=0; + for(int i=2;i Date: Wed, 2 Dec 2020 13:43:04 +0530 Subject: [PATCH 02/12] Update Prime.java --- Java/cp/Prime.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Java/cp/Prime.java b/Java/cp/Prime.java index b25f5a7221..68fd46df7f 100644 --- a/Java/cp/Prime.java +++ b/Java/cp/Prime.java @@ -15,4 +15,11 @@ public static void main(String args[]) } } //* Contributed By ErzaTitani-2001 +/* Sample Input and Output : +Input : +Enter a number : 13 +Output : +13 is a Prime Number. +Space Complexity : O(1) +Time Complexity : O(n) */ From 50be9495838186fb9142bf234fd40fcf2037d7ca Mon Sep 17 00:00:00 2001 From: "@2001!" <59911272+ErzaTitania-2001@users.noreply.github.com> Date: Wed, 2 Dec 2020 13:46:47 +0530 Subject: [PATCH 03/12] Updated time, space complexity --- Java/cp/PrimeRecursion.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Java/cp/PrimeRecursion.java b/Java/cp/PrimeRecursion.java index 831d66b2c4..9f6a23f11f 100644 --- a/Java/cp/PrimeRecursion.java +++ b/Java/cp/PrimeRecursion.java @@ -22,4 +22,11 @@ public static void main(String args[]) } } //* Contributed By ErzaTitani-2001 +/* Sample Input and Output : +Input : +Enter a number : 13 +Output : +13 is a Prime Number. +Space Complexity : O(n) +Time Complexity : O(n) */// From 2e8e4042abb5bc44d6737be1b1a15484bb98029c Mon Sep 17 00:00:00 2001 From: "@2001!" <59911272+ErzaTitania-2001@users.noreply.github.com> Date: Wed, 2 Dec 2020 13:55:26 +0530 Subject: [PATCH 04/12] Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 3532276294..270f66c910 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -164,6 +164,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Jayant Goel

💻
Gaurav

💻
Ashutosh_K_Sah

💻 + td align="center">
Ahana Pal

💻 💻 From 39848290d3eda2db53fc6c98ae1dd240edc66769 Mon Sep 17 00:00:00 2001 From: "@2001!" <59911272+ErzaTitania-2001@users.noreply.github.com> Date: Wed, 2 Dec 2020 14:06:06 +0530 Subject: [PATCH 05/12] Updated as mentioned by @iamrajib --- Java/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Java/README.md b/Java/README.md index b9842935b8..7e1b4f3ab5 100644 --- a/Java/README.md +++ b/Java/README.md @@ -42,6 +42,9 @@ _add list here_ - [Check for Subsequence](cp/CheckForSubSequence.java) - [Factorial of large numbers](cp/Factorial_large_numbers.java) - [Happiness Problem (cp sets question)](cp/HappinessProblem.java) +- [Prime Number With Recursion](https://github.com/ErzaTitania-2001/NeoAlgo/blob/master/Java/cp/PrimeRecursion.java) +- [Prime Number without Recursion](https://github.com/ErzaTitania-2001/NeoAlgo/blob/master/Java/cp/Prime.java) + ## Cryptography From 534133393fd10e5116fa65da75dba58f61cf6e5b Mon Sep 17 00:00:00 2001 From: Rajiv Singh Date: Wed, 2 Dec 2020 14:22:42 +0530 Subject: [PATCH 06/12] Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 270f66c910..3532276294 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -164,7 +164,6 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Jayant Goel

💻
Gaurav

💻
Ashutosh_K_Sah

💻 - td align="center">
Ahana Pal

💻 💻 From e6ddca7089cb97d262cef8ecd862f601cb7f554b Mon Sep 17 00:00:00 2001 From: Rajiv Singh Date: Wed, 2 Dec 2020 14:23:20 +0530 Subject: [PATCH 07/12] Update README.md --- Java/README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/Java/README.md b/Java/README.md index 7e1b4f3ab5..2660b32cb3 100644 --- a/Java/README.md +++ b/Java/README.md @@ -45,7 +45,6 @@ _add list here_ - [Prime Number With Recursion](https://github.com/ErzaTitania-2001/NeoAlgo/blob/master/Java/cp/PrimeRecursion.java) - [Prime Number without Recursion](https://github.com/ErzaTitania-2001/NeoAlgo/blob/master/Java/cp/Prime.java) - ## Cryptography - [Caesar Cipher](cryptography/ceaserCipher.java) @@ -101,7 +100,6 @@ _add list here_ ## Dynamic Programming - - [Kandane Algorithm](dp/Kadane_Algorithm.java) - [Longest common subsequence](dp/LCS.java) - [Maximum sum rectangle of 2D array](dp/MaximumSumRectangle.java) @@ -110,7 +108,6 @@ _add list here_ - [Coin Change Problem Using DP](dp/CoinChangeUsingDp.java) - [Rectangle Cutting Using DP](dp/Rectangle_cutting.java) - ## Blockchain _add list here_ From aa85a3cf7954579ceb434c99288a12fdfe7bab9d Mon Sep 17 00:00:00 2001 From: Rajiv Singh Date: Wed, 2 Dec 2020 14:24:26 +0530 Subject: [PATCH 08/12] Update Prime.java --- Java/cp/Prime.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Java/cp/Prime.java b/Java/cp/Prime.java index 68fd46df7f..9f1d7828a6 100644 --- a/Java/cp/Prime.java +++ b/Java/cp/Prime.java @@ -1,4 +1,5 @@ -//check whether a number is Prime or not without recursion// +// check whether a number is Prime or not without recursion + import java.util.Scanner; class Prime { @@ -14,12 +15,15 @@ public static void main(String args[]) System.out.println(n+((c==0)?" is a Prime Number." :" is not a Prime Number.")); } } -//* Contributed By ErzaTitani-2001 -/* Sample Input and Output : -Input : + +// Contributed By ErzaTitani-2001 + +/* +Sample Input and Output : +Input : Enter a number : 13 -Output : +Output : 13 is a Prime Number. Space Complexity : O(1) -Time Complexity : O(n) */ - +Time Complexity : O(n) +*/ From f790ae64d4d83231b12d22070f682227578572df Mon Sep 17 00:00:00 2001 From: Rajiv Singh Date: Wed, 2 Dec 2020 14:25:17 +0530 Subject: [PATCH 09/12] Update PrimeRecursion.java --- Java/cp/PrimeRecursion.java | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Java/cp/PrimeRecursion.java b/Java/cp/PrimeRecursion.java index 9f6a23f11f..1e4fd2e701 100644 --- a/Java/cp/PrimeRecursion.java +++ b/Java/cp/PrimeRecursion.java @@ -1,4 +1,5 @@ -//check whether a number is Prime or not with recursion// +// check whether a number is Prime or not with recursion + import java.util.Scanner; class PrimeRecursion { @@ -9,7 +10,7 @@ public static int prime(int n,int div) prime(n,div+1); else return 0; - } + } return 1; } public static void main(String args[]) @@ -21,12 +22,15 @@ public static void main(String args[]) System.out.println(n+((c!=0)?" is a Prime Number." :" is not a Prime Number.")); } } -//* Contributed By ErzaTitani-2001 -/* Sample Input and Output : -Input : + +// Contributed By ErzaTitani-2001 + +/* +Sample Input and Output : +Input : Enter a number : 13 -Output : +Output : 13 is a Prime Number. Space Complexity : O(n) -Time Complexity : O(n) */// - +Time Complexity : O(n) +*/ From 1efe57eabdecdf92a0b612992f00d6aed78888d6 Mon Sep 17 00:00:00 2001 From: Rajiv Singh Date: Wed, 2 Dec 2020 14:27:26 +0530 Subject: [PATCH 10/12] Update README.md --- Java/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Java/README.md b/Java/README.md index 2660b32cb3..0538c685fb 100644 --- a/Java/README.md +++ b/Java/README.md @@ -42,8 +42,8 @@ _add list here_ - [Check for Subsequence](cp/CheckForSubSequence.java) - [Factorial of large numbers](cp/Factorial_large_numbers.java) - [Happiness Problem (cp sets question)](cp/HappinessProblem.java) -- [Prime Number With Recursion](https://github.com/ErzaTitania-2001/NeoAlgo/blob/master/Java/cp/PrimeRecursion.java) -- [Prime Number without Recursion](https://github.com/ErzaTitania-2001/NeoAlgo/blob/master/Java/cp/Prime.java) +- [Prime Number With Recursion](cp/PrimeRecursion.java) +- [Prime Number without Recursion](cp/Prime.java) ## Cryptography From dfa7f6d3c4e471f6f4d6a08637d115d24d8f533d Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2020 08:58:20 +0000 Subject: [PATCH 11/12] docs: update CONTRIBUTORS.md [skip ci] --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 3532276294..c6ba154fe1 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -164,6 +164,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Jayant Goel

💻
Gaurav

💻
Ashutosh_K_Sah

💻 +
@2001!

💻 From 6c0429c535176eb54d892f501c38cd8c49ff9db7 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2020 08:58:21 +0000 Subject: [PATCH 12/12] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index d432bec176..d7ff303ab1 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1127,6 +1127,15 @@ "contributions": [ "code" ] + }, + { + "login": "ErzaTitania-2001", + "name": "@2001!", + "avatar_url": "https://avatars3.githubusercontent.com/u/59911272?v=4", + "profile": "https://github.com/ErzaTitania-2001", + "contributions": [ + "code" + ] } ], "repoType": "github",