Just to attract your attention. :cheesy: :lol: :cool: ;)
Here's the problem:
I have this string "flames". Then I get a number from earlier part of myprogram. Let the number be 4. Now 'm' is the 4th character. This should be removed. Then the remaining string is "flaes". Now 'e is the fourth char. This should be removed. Finally only one character remains standing. This character should be displayed.
chound
1
Junior Poster
Recommended Answers
Jump to PostWhat happens when the length of the string is less than the index you're removing from? Show me this hypothetical algorithm to it's logical conclusion. For example, remove 'e'. Then remove 's'. Then what?
Jump to PostThe algorithm you're talking about is called the Josephus problem.
Jump to Post>So plz convert it into c++ code.
I'm sorry, did you just ask me to do your work for you? I've already implemented this algorithm in several different ways, so I won't learn anything from it. Therefore, I'll leave it up to you.
Jump to PostThen you'd better get started. You seem to think I give a damn about your deadlines. I might help you with your implementation if you prove that you've actually tried to come up with something. Otherwise I'll just write you off as a freeloading loser who deserves a failing grade.
All 14 Replies
Narue
5,707
Bad Cop
Team Colleague
chound
1
Junior Poster
Narue
5,707
Bad Cop
Team Colleague
chound
1
Junior Poster
Narue
5,707
Bad Cop
Team Colleague
chound
1
Junior Poster
Narue
5,707
Bad Cop
Team Colleague
chound
1
Junior Poster
Asif_NSU
25
Posting Whiz
chound
1
Junior Poster
Narue
5,707
Bad Cop
Team Colleague
chound
1
Junior Poster
Asif_NSU
25
Posting Whiz
Narue
5,707
Bad Cop
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.