Write a program to implement flood–fill algorithm.