Imagine the following pseudocode
objects[i], 1 <= i <= n
objects[0] = 0
for i from 1 to n
if(objects[i] - objects[i-1] > constant)
do something
I'd like to know if there's a specific name for the assignment objects[0] = 0
.
I know that when values like these are used to stop loops, they are called sentinel values.
In this case, however, I'm using it so that the first object evaluated (objects[1]) will have something to compare against - obviously, objects[0]
is not a real object, just sort of a flag. Is it still called a sentinel value? Is there another name for this? Or should I not be doing this at all?
Let me know if I haven't made myself clear and I should try to explain my question in another way.