tag:blogger.com,1999:blog-6912797365202061321.post4689988104970026346..comments2016-07-21T23:30:15.175-07:00Comments on Engineering Code: Josephus ProblemAmit Wadhwanoreply@blogger.comBlogger1125tag:blogger.com,1999:blog-6912797365202061321.post-24750261695338238182010-03-06T22:36:18.430-08:002010-03-06T22:36:18.430-08:00Hi,
I just wanted to drop a line and say thanks f...Hi,<br /><br />I just wanted to drop a line and say thanks for posting this solution first of all.<br />But i tried it, and i do want to point out that the recursive function seems to always miss the "survivor's" position by one.<br /><br />For example, when there are 41 people in the circle and every 3rd person is eliminated, the person in position 31 should be the survivor (1 based not zero). The recursive solutions returns 30 instead of 31. Then i tried it with other values and i found that i always had to add 1 to whatever answer is returned by the recursive solution to get the right survivor.<br /><br />Thanks.Georgehttps://www.blogger.com/profile/10976152821231570650noreply@blogger.com