.. (לתיקייה המכילה) | ||
Q: In Question 1, is it OK if my function calls helping functions, and those are recursive. For example: | |
A: No, this is NOT OK. Your function should call **itself**. Furthermore: any solution in which the original function, with the given signature, doesn't call itself is NOT OK. |
Q: In Question 2 section 6, if I think chosen2 is of size different than 3, | |
A: If, for example, you think chosen2 is of size 2 and both its cells contain true: printf("content of chosen2 array after second recursive call in b: [%s]","1,1") If, for example, you think chosen2 is of size 4 and all its cells contain true: printf("content of chosen2 array after second recursive call in b: [%s]","1,1,1,1") etc. Note that in any case there are no spaces. |
Q: Can we use loops in question 3? | |
A: Yes. |
Q: In question 3, should we always check that the number of mandates is more than 60? or more than half of the sum? | |
A: More than 60. That being said, you shouldn't assume the sum of mandates in the mandates array will always be 120. It can be smaller or bigger than 120. |
Q: The files you provided us in questions 2 and 3 contain rows longer than the 75 chars allowed. should we change them? | |
A: No. This won't affect your grade. |
Q: You have a mistake in hw5_q3_main.c. The variable max should have been initialized before its address was passed to the function count_coalitions. | |
A: This is not a mistake. When you implement a function that receives a pointer as parameter, you should never assume that the variable it points to is initialized. If you need it to be initialized, initialize it yourself, inside the function. Note: In general, you should also check that the pointer is not null before using operator * on it, but this is not necessary in this exercise. |
Q: In question 2: In section b, when you say "when calling the function" do you mean when a calls b or when b calls d? | |
A: In section b - when a calls b. In sections 3-4 - in the point of time when the call b executes line number 10 (note that each square executes line number 10 only once) |