Computing connectedness: disconnectedness and discreteness