Implemented sequential connected component.