From 7626447a82256b6a271aa6d3484010b762d3621a Mon Sep 17 00:00:00 2001 From: WORLDSAVER Date: Tue, 16 Aug 2022 07:49:07 +0530 Subject: [PATCH] New branch --- algorithms/Python/README.md | 2 -- .../Python/number_theory/prime_number.py | 20 ------------------- 2 files changed, 22 deletions(-) delete mode 100644 algorithms/Python/number_theory/prime_number.py diff --git a/algorithms/Python/README.md b/algorithms/Python/README.md index 7cfd6fa9..c511a04b 100644 --- a/algorithms/Python/README.md +++ b/algorithms/Python/README.md @@ -85,5 +85,3 @@ - [First in First out Queue](queues/fifo-queue.py) -##Number Theory -- [Prime Number Checker][number_theory/prime_number.py] \ No newline at end of file diff --git a/algorithms/Python/number_theory/prime_number.py b/algorithms/Python/number_theory/prime_number.py deleted file mode 100644 index 063f16f8..00000000 --- a/algorithms/Python/number_theory/prime_number.py +++ /dev/null @@ -1,20 +0,0 @@ -#TO CHECK WHETHER A NUMBER IS PRIME OR NOT - - -def isPrime(N): - - for i in range(2, int(N**0.5) + 1): - if N%i==0: - return False - - return True - -# TIME COMPLEXITY - O(sqrt(N)) - -# EXAMPLES -# print(isPrime(3)) -> True -# print(isPrime(15)) -> False - -# We are just checking till sqrt(N) as if their is any factor of a number -# greater than sqrt(N) then it's partner will be less than sqrt(N) as if a*b>N -# and a>=sqrt(N) then b<=sqrt(N) as if b>sqrt(N) then a*b>N.