Data Structures, Algorithms, & Applications in C++
Chapter 9, Exercise 19

You can use a stack in the image component labeling problem. This will not affect the outcome. In the remaining applications, correctness is affected.