Added algorithm and tests for calculation of connected components sizes.