There are N egg baskets and the number of eggs in each
basket is a known quantity. Two players take turns to remove
these eggs from the baskets. On each turn, a player must
remove at least one egg, and may remove any number of eggs
provided they all belong to the same basket. The player
picking the last egg(s) wins the game. If you are allowed to
decide who is going to start first, what mathematical
function would you use to decide so that you end up on the
winning side?
Answer Posted / guest
n-1 if n is odd and n+1 if n is even
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
What are void pointers in c?
Which is the memory area not included in C program? give the reason
Can we change the value of constant variable in c?
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
What is the purpose of void in c?
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
Can we replace the struct function in tree syntax with a union?
Is int a keyword in c?
What are the restrictions of a modulus operator?
write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...
Tell me is null always defined as 0(zero)?
What is a sequential access file?
Are there any problems with performing mathematical operations on different variable types?
The purpose of this exercise is to benchmark file writing and reading speed. This exercise is divided into two parts. a). Write a file character by character such that the total file size becomes approximately >10K. After writing close the file handler, open a new stream and read the file character by character. Record both times. Execute this exercise at least 4 times b). Create a buffer capable of storing 100 characters. Now after generating the characters, first store them in the buffer. Once the buffer is filled up, store all the elements in the file. Repeat the process until the total file size becomes approximately >10K.While reading read a while line, store it in buffer and once buffer gets filled up, display the whole buffer. Repeat the exercise at least 4 times with different size of buffer (50, 100, 150 …). Records the times. c). Do an analysis of the differences in times and submit it in class.
Explain the process of converting a Tree into a Binary Tree.