.. (לתיקייה המכילה) | ||
Q: In question 2, how do I know that I need to stop reading if the user entered less than 10 strings? | |
A: You can stop reading strings when you reach the end of the input from the user. Recall that if you reach the end of the input, the return value of scanf will be EOF. |
Q: In question 1, do the arrays "movies" and "movies_descriptions" count as part of the space complexity? | |
A: No, they don't. They are considered part of the input. This means you can only use a constant number of extra variables in the function "recommended_movie" in order to achieve the O(1) space complexity. |
Q: In class we used an array of strings to store multiple strings, and in the exercise you ask us to use a two dimensional array of chars. Are they the same? | |
A:No, they are not the same. You should not pass an array of strings to the function which requires a 2 dimensional array. However, if you write a string to movies[0] (for example, from question 1), it is ok to use it like a string. For example, it is ok to write strlen(movies[0]). |
Q: In question 3 I compiled the code in Codeblocks and I got a compilation error. Is this enough to say that the code causes a compilation error? | |
A: Not exactly. In this section when we say "compilation error" we mean an error in the syntax. Having an unused variable, for example, is not such an error. |