Изменения

Перейти к: навигация, поиск
Псевдокод
'''boolean''' marked[n][n]
<font color="green">// Шаг 3</font>
'''for''' i = 0 .. <tex>\ldots</tex>n - 1 '''for''' j = 0 .. <tex>\ldots</tex>n - 1
'''if''' '''not''' marked[i][j] '''and''' isTerminal[i] != isTerminal[j]
marked[i][j] = marked[j][i] = ''true''
'''int'''[] component[n] <font color="green">// По позиции i будем хранить номер компоненты эквивалентности для i-ого состояния.</font>
fill(component, -1)
'''for''' i = 0<tex>\ldots </tex>n - 1
'''if''' '''not''' marked[0][i]
component[i] = 0
'''int''' componentsCount = 0
'''for''' i = 1 .. <tex>\ldots</tex>n - 1
'''if''' '''not''' reachable[i]
''continue''
componentsCount++
component[i] = componentsCount
'''for''' j = i + 1 .. <tex>\ldots</tex>n - 1
'''if''' '''not''' marked[i][j]
component[j] = componentsCount
200
правок

Навигация