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

Java implementation for Josephus Problem added. #1410

Merged
merged 5 commits into from
May 29, 2019

Conversation

KaushalSahu
Copy link
Contributor

Fixes #1407

Checklist:

  • 4 space indentation.
  • Coding conventions are followed.
  • Input is taken dynamically.
  • Sample Input / Output is added at the end of file.
  • Logic Documentation (Comments).
  • File names are correct.

Changes proposed in this pull request:

  • Java code for Josephus Problem

Languages Used:

  • Java

Files Added:

  • Josephus_Problem.java

Thanks!

@manbirmarwah
Copy link
Contributor

Why did you close #1408? You were supposed to make changes in that only.

Copy link
Contributor

@manbirmarwah manbirmarwah left a comment

Choose a reason for hiding this comment

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

Indentation still doesn't seem to be fixed.

@KaushalSahu
Copy link
Contributor Author

I have changed the indentation manually from 8 spaces tab to 4 spaces, what else indentation issue is with that I am not getting it. I closed #1408 because it would have made it two commits.

@manbirmarwah
Copy link
Contributor

There is still tab indentation in the code. You have to use 4-space indentation in place of 1 tab, 8 space indentation for 2 tabs and so on...
You can check in other PRs if you're having confusion.

@KaushalSahu
Copy link
Contributor Author

I have used same indentation scheme 4-space indentation in place of 1 tab, 8 space in place of 2 tabs and even checked #1398 PR also, it is also using the same indentation scheme. Even I have checked it on GitHub editor also it is 4 space only. Even I copied the code from "Files changed" from the patch #1410 in vim editor their also the count is 4, 8 and so on. @marwahmanbir please can you be more specific as I'm not able to figure out what point I'm missing.

{
public static int Josephus(int n, int m) {
// base case when only 1 person left return 0 assuming people numbered from 0 to n -1
if (n == 1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

In above few lines the indentation is perfect but from this line onwards there is tab indentation (where 1 tab equivalent to ~ 8 spaces).
You have to convert the whole program to incorporate space indentation instead of tabs.

Implemented Space indentation using git editor.
@KaushalSahu
Copy link
Contributor Author

Screenshot from 2019-05-27 15-54-05

@KaushalSahu
Copy link
Contributor Author

Please check the last commit I've understood my mistake and updated it accordingly.

@KaushalSahu
Copy link
Contributor Author

@marwahmanbir please review this PR as I want to contribute further.

Copy link
Contributor

@manbirmarwah manbirmarwah left a comment

Choose a reason for hiding this comment

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

Good work.

@jainaman224 jainaman224 merged commit 119efe9 into jainaman224:master May 29, 2019
@KaushalSahu KaushalSahu deleted the Josephus_Problem branch May 30, 2019 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Josephus problem implementation in java
3 participants