Connected components sample code

Connected components code