As you may already know, iterative and recursive algorithms are interchangeable. As far as I can tell, your algorithm is equivalent to:

void fill(int left, int right, int top, int bottom, int...