Пример #1
0
void digraph::sortAdjLists() {
// Sort all the adjacency lists and initialize li values.
    vertex u;
    edge e;
    for (u = 1; u <= n(); u++) {
        sortAlist(u);
        // now recompute li values
        li[u] = Null;
        for (e = first(u); e != term(u); e = next(u,e)) {
            if (u == head(e)) li[u] = e;
        }
    }
}
Пример #2
0
/** Sort all the adjacency lists. */
void Graph::sortAdjLists() {
	for (vertex u = 1; u <= n(); u++) sortAlist(u);
}