212
правок
Изменения
м
→Псевдокод второго прохода
'''function''' <tex>paint</tex>(<tex>v</tex>, color):
colors[<tex>v</tex>]<tex>\leftarrow</tex> color
'''for''' <tex>u \in V : (u, v) \in E</tex>:
'''if''' colors[<tex>u</tex>] == 0:
...
'''for''' <tex>v \in V</tex> :
colors[<tex>v</tex>]<tex>\leftarrow 0 </tex>0 maxColor <tex>\leftarrow 0</tex>0
'''for''' <tex>v \in V</tex> :
'''if''' colors[<tex>v</tex>] == 0: