Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

sieve of eratosthenes implemented #86

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

prachiagrawal269
Copy link

References #4
Please review

@aktech
Copy link
Member

aktech commented May 13, 2016

@prachiagrawal269 Please fix conflicts.

@goelakash
Copy link
Collaborator

goelakash commented May 17, 2016

@prachiagrawal269 Please fix conflicts and squash commits.

@prachiagrawal269 prachiagrawal269 force-pushed the sieve_of_eratosthenes branch 3 times, most recently from 8fca1f2 to 929e790 Compare May 21, 2016 03:50
Reformatted radix_sort.py and some docs

Add Rehas and Rahul to Authors

Fixes pydsa#41 (pydsa#72)

* Fixes pydsa#41

* Added doc string and code changes

* Addressing changes

;
q'

* Correcting spelling

Add Binary Tree implementation, tests

Modify delete function and add docstrings to binary_tree

Add Kanika to AUTHORS. Welcome to PyDSA!

Added Gnome Sort

Remove import *

Squashed commits

Nameerror removed

Squashed commits
@goelakash
Copy link
Collaborator

goelakash commented May 21, 2016

@aktech I was thinking if this should be optimized. Checking for even non-primes first, lets us use increments of 2*i instead of i (as all even numbers are filtered beforehand).
For eg:

not_prime[2] = False
for i in range(3,lim):
    if i%2 == 0:
        not_prime[i] = True

for i in range(3, lim):
    if not_prime[i] == False:
        for j in range(i*i,lim,2*i):
            not_prime[j] = True

@tapaswenipathak
Copy link

#12 too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants