static getConnectedComponents(adjacencyMatrix) {
    let length = adjacencyMatrix.length;
    let visited = new Array(length);
    let components = new Array();
    let count = 0;
    visited.fill(false);

    for (var u = 0; u < length; u++) {
      if (!visited[u]) {
        let component = Array();
        visited[u] = true;
        component.push(u);
        count++;

        Graph._ccGetDfs(u, visited, adjacencyMatrix, component);

        if (component.length > 1) {
          components.push(component);
        }
      }
    }

    return components;
  }
Returns the connected components of the graph.

@param {Array[]} adjacencyMatrix An adjacency matrix.
@returns {Set[]} Connected components as sets.