Static and Dynamic Parallel Computation of Connected Components