Thursday, September 8, 2016

#algorithm discussion continued
Today we continue reading the flow networks. We were looking at maximum flows
Maximum flows can also be calculated using "push-relabel" method. This method works in a more localized manner than Ford Fulkerson method. It works on one vertex at a time, looking only at the vertex's neighbour in the residual network. Thus it avoids examining the entire residual network to find an augmenting path. Also, they do not maintain flow conservation. Instead they maintain a preflow property which goes to say that the total flow into a vertex may exceed the flow out.

#codingexercise
Void getkthfirst(node head, int k, ref int count, ref node kthfirst)
{
If (head == null) return;
count = count + 1;
if (count==k) { kthfirst = head; return;}
Getkthfirst(head.next, k, ref count, ref kthfirst);
}

No comments:

Post a Comment