Apple Interview Question

C++ polymorphism and overloading. Find connected components from a binary image.