I am trying to implement the hacker3 sorting algorithm. The one that requires a O(n). I think I have figured out the algorithm but I won't spoil it by posting any code here.
My question is regarding to the inputs. It says that we are not allowed to change the definition of the functions and that the maximum available value constant can be used. I should mention here that the number is given as a const int
and is not defined as an alias.
The problem arises at the point where we need to access that number from a library declared before the number. The only solution I figured out was to re-declare it in the library, this implies that a change of that number per-compilation would be impossible to detect. Is there any way to actually access it? Or should we just live with the re-declaration?
extern
. Do you have something particular in mind? If not don't bother about it, I just assumed that it can be redefined locally in the headers.c file, its a constant anyway... I don't even think there is a way to access it but thanks.