Skip to content

i did some experiment let's check it #7

Closed
mikeyoni wants to merge 2 commits intoachille010:mainfrom
mikeyoni:main
Closed

i did some experiment let's check it #7
mikeyoni wants to merge 2 commits intoachille010:mainfrom
mikeyoni:main

Conversation

@mikeyoni
Copy link

@mikeyoni mikeyoni commented Mar 7, 2026

:D

Copy link
Author

@mikeyoni mikeyoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks so much for taking the time to look at my code and suggest improvements I really appreciate it!

You made a great point about adding a primeCount variable, I've gone ahead and included that in the updated version. It's a nice touch to show the total at the end.

After reviewing both approaches, I've decided to stick with the Sieve of Eratosthenes since it has better time complexity (O(n log log n) vs O(n√n)) for larger inputs, even though your trial division solution is clean and works well too.

The main bug I fixed was the missing vector isPrime(n + 1, true) declaration that was causing the compile error in my original code. I also cleaned up the output formatting.

Thanks again for the benchmark results and for sharing your approach it was helpful to see the comparison!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am also learning and I am a beginner, but today’s beginner is tomorrow’s future. I am trying to gather some programmer friends so we can make big projects together and contribute to big projects. That’s it.

if u intarested then feel free to join :D https://discord.gg/x9WukYXv

@achille010 achille010 closed this Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants