![]() |
.. (לתיקייה המכילה) | |
In Question 1, can I set MAX_DIGITS to any number I want? | |
This constant should be 30 to handle all digits. There is no need to put 0 or '\0' in the end, because the representation of a big number is an array and not a string. However, you CAN declare the array to be of length 31, or even implement them as strings. |
In Question 1, can I use malloc? | |
Yes, and you can include <stdlib.h> for that. However, you don't have to. Since the program will get at most 20 numbers, you can define a 2D array with 20 rows and 30 columns (or 31). |
In Question 2, how can I search in O(log k) if the dictionary is not sorted? | |
You can declare them in you program already sorted. |