|
| 1 | +<h1 align='center'>SIEVE - OF - ERATOSTHENES - ALGORITHM</h1> |
| 2 | + |
| 3 | +This repository contains a collection of coding problems related to the **Sieve of Eratosthenes** algorithm, which is used to find all prime numbers up to a specified integer `n`. The problems here span across both **LeetCode** and **GeeksforGeeks (GFG)** platforms, offering a variety of challenges that will help you gain a deeper understanding of this efficient algorithm for prime number generation. |
| 4 | + |
| 5 | +### Sieve of Eratosthenes Overview: |
| 6 | +The **Sieve of Eratosthenes** is one of the most efficient ways to identify all prime numbers up to a given number `n`. The basic idea is to iteratively mark the multiples of each prime number starting from `2`, and the remaining unmarked numbers are the primes. |
| 7 | + |
| 8 | +### Repository Contents: |
| 9 | +This repository provides problems that focus on both the algorithm and its various applications, including: |
| 10 | + |
| 11 | +- **Prime Number Detection** |
| 12 | +- **Prime Factorization** |
| 13 | +- **Optimized Approaches** to the Sieve of Eratosthenes |
| 14 | +- **Applications in Competitive Programming** |
| 15 | + |
| 16 | +### Repository Content |
| 17 | +<p> |
| 18 | +<img src="https://img.shields.io/badge/problems%20count-02-orange?logo=leetcode" alt="LeetCode"> |
| 19 | +<img src="https://img.shields.io/badge/problems%20count-03-darkgreen?logo=geeksforGeeks" alt="GeeksforGeeks"> |
| 20 | +<img src="https://img.shields.io/badge/total%20problems%20count-04-blue" alt="Problem Count"> |
| 21 | +</p> |
| 22 | + |
| 23 | +| No | Problem Name | Description | Leetcode | GFG | |
| 24 | +|-----|-------------------------------|-------------------|-------------------|-------| |
| 25 | +| 01 | [Count Primes](https://github.com/JawadSher/DSA-LeetCode-GFG-Problems-Repository/tree/main/09%20-%20Sieve%20of%20Eratosthenes%20%26%20Segmented%20Sieve%20Problems/01%20-%20Count%20Primes) | Counts the number of prime numbers less than a given number `n`. | [Link](https://leetcode.com/problems/count-primes/) | Non | |
| 26 | +| 02 | [Count Primes in Range](https://github.com/JawadSher/DSA-LeetCode-GFG-Problems-Repository/tree/main/09%20-%20Sieve%20of%20Eratosthenes%20%26%20Segmented%20Sieve%20Problems/02%20-%20Count%20Primes%20in%20Range) | Counts the number of prime numbers in a given range `[a, b]`. | Non | [Link](https://www.geeksforgeeks.org/count-primes-in-a-range/) | |
| 27 | +| 03 | [Sieve of Eratosthenes](https://github.com/JawadSher/DSA-LeetCode-GFG-Problems-Repository/tree/main/09%20-%20Sieve%20of%20Eratosthenes%20%26%20Segmented%20Sieve%20Problems/03%20-%20Seive%20of%20Eratosthenes) | Implements the Sieve of Eratosthenes algorithm to find all prime numbers up to `n`. | [Link](https://leetcode.com/problems/sieve-of-eratosthenes/) | [Link](https://www.geeksforgeeks.org/sieve-of-eratosthenes/) | |
| 28 | +| 04 | [Product of Primes](https://github.com/JawadSher/DSA-LeetCode-GFG-Problems-Repository/tree/main/09%20-%20Sieve%20of%20Eratosthenes%20%26%20Segmented%20Sieve%20Problems/04%20-%20Product%20of%20Primes) | Calculates the product of all primes up to a given number `n`. | Non | [Link](https://www.geeksforgeeks.org/problems/product-of-primes5328/1?itm_source=geeksforgeeks&itm_medium=article&itm_campaign=practice_card) | |
| 29 | + |
| 30 | +This table summarizes the problems with their brief descriptions and available links to LeetCode and GFG, if applicable. |
| 31 | + |
| 32 | +### Problems in this Repository: |
| 33 | +Each problem in this repository provides an opportunity to implement the **Sieve of Eratosthenes** in different contexts, such as: |
| 34 | +- Finding all prime numbers up to `n`. |
| 35 | +- Using the sieve to solve mathematical problems efficiently. |
| 36 | +- Optimizing algorithms that involve prime numbers. |
| 37 | + |
| 38 | +### Platforms: |
| 39 | +- **LeetCode**: A set of problems available on LeetCode that help solidify the understanding of the Sieve of Eratosthenes. |
| 40 | +- **GeeksforGeeks**: A collection of algorithmic challenges on GFG where the sieve technique is applied to solve various problems. |
| 41 | + |
| 42 | +Feel free to explore, solve, and contribute to any of the problems listed in this repository. |
| 43 | + |
| 44 | +--- |
| 45 | + |
| 46 | +Happy Coding 😊 |
0 commit comments