Изменения

Перейти к: навигация, поиск
м
отступы в псевдокоде
'''int''' dfs('''int''' <tex>v</tex>, '''int''' flow)
'''if''' (flow == 0) '''return''' 0 '''if''' (<tex>v</tex> == <tex>t</tex>) '''return''' flow '''for''' (<tex>u</tex> = ptr[<tex>v</tex>] '''to''' n) <font color=darkgreen> // u - ссылочный тип</font> '''if''' (<tex>vu \in E</tex>) pushed = dfs(<tex>u</tex>, min(flow, c(<tex>vu</tex>) - f(<tex>vu</tex>))); f(<tex>vu</tex>) += pushed f(<tex>uv</tex>) -= pushed '''return''' pushed '''return''' 0
'''main'''( )
'''for''' ('''int''' i = 0 '''to''' n)
ptr[i] = 0;
'''do''' pushed = '''dfs''' (<tex>s</tex>, <tex>\infty</tex>) flow += pushed; '''while''' (pushed > 0)
25
правок

Навигация