Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Josephus Problem in C++ #1559

Merged
merged 6 commits into from
Dec 28, 2020

Conversation

YASH01009
Copy link
Contributor

Have you read the Contributing Guidelines on Pull Requests?

(Yes)

Description

(Added Josephus Problem in C++)

Checklist

  • [Y] I've read the contribution guidelines.
  • [Y] I've checked the issue list before deciding what to submit.
  • [Y] I've edited the README.md and link to my code.

Related Issues or Pull Requests

(Issue #1525 is solved here)

@shraddhavp
Copy link
Contributor

conflicts to be resolved @YASH01009

Copy link
Contributor

@iamrajiv iamrajiv left a comment

Choose a reason for hiding this comment

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

@YASH01009 Add non-recursive form too.

Copy link
Contributor

@atarax665 atarax665 left a comment

Choose a reason for hiding this comment

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

Use better name for your variables and format input output to make the code more understandable.

@@ -0,0 +1,35 @@
/**
Josephus problem is a famous problem.
Copy link
Contributor

Choose a reason for hiding this comment

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

Add problem link from any competitive programming website.

Copy link
Owner

Choose a reason for hiding this comment

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

Please do add the same.

@YASH01009
Copy link
Contributor Author

changes done !!

Time Complexity : O(n)
Space Complexity : O(1)

**/
Copy link
Owner

Choose a reason for hiding this comment

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

Add a new line at the end of the Code.

@@ -0,0 +1,35 @@
/**
Josephus problem is a famous problem.
Copy link
Owner

Choose a reason for hiding this comment

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

Please do add the same.

@shraddhavp shraddhavp merged commit 421b33e into HarshCasper:master Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants