It covers all the elements of a cycle
while vis [ j ] == False : NEW_LINE INDENT vis [ j ] = True NEW_LINE v . append ( sortedarr [ j ] [ 0 ] ) NEW_LINE j = sortedarr [ j ] [ 1 ] NEW_LINE size += 1 NEW_LINE DEDENT