Assignment for CS 🥺 | SoloLearn: Learn to code for FREE!

-3

Assignment for CS 🥺

You are holding a contest to determine the ultimate penny champion. Each participant in the contest has decided which side of the penny they like, heads or tails, and keeps that decision to themselves. We represent heads using the boolean value true and tails using false. The contest participants all get in a long line (array). They start by pairing up (the first two, second two, and so forth). After the two members reveal their pennies to each other, if both are the same, the first (left) person wins, otherwise, the second (right) person wins. The remaining members then battle it out the same way in the next round until only one winner emerges. If there are an odd number of people in any round, the last person gets a “bye” and automatically survives to the following round. Solve the problem recursively by writing the following method: public static int champion(boolean[] a) Return the index corresponding to the winner of the contest. You do not need to allocate any arrays for this problem

1/22/2020 10:34:38 PM

Khaoula / Kayla Caty

12 Answers

New Answer

+10

Hello! Do you have an attempt at this problem? If you need help with it, please be specific with what exactly is giving you issues as otherwise there'll be little that can be done to help

+1

Oh okay, thank you!

0

I basically don't know where to start 🥺

0

Where is it from? If it is from school, your teacher should have told you the basics of C#. You could check out SL's course to get some help. It explains data types, loops, etc.

0

No its java programmint, and we specifically need to use recursion

0

Since I find it interesting, I will see what I can do with it in a few hours. I'm not making any promise, tho.

0

Okay, thank u so much ❤

0

Use this as a blueprint to finish your assignment https://code.sololearn.com/cFz8Zn13NQvE/?ref=app

0

Oh wow, did u try it, did it work? is it recursion?

0

No, I did not finish it. You will need recursion to ignore the pairs of playera that lose

0

Wanna to learn html

-2

8upXUlizUIzhuji8