author | deba |
Wed, 14 Jul 2004 10:05:31 +0000 | |
changeset 700 | 236117f60eee |
parent 674 | 7733d18de0e8 |
child 701 | c03e073b8394 |
permissions | -rw-r--r-- |
deba@378 | 1 |
#include <iostream> |
deba@595 | 2 |
#include <cstdlib> |
deba@698 | 3 |
#include "list_graph.h" |
deba@378 | 4 |
|
deba@378 | 5 |
using namespace std; |
deba@378 | 6 |
using namespace hugo; |
deba@378 | 7 |
|
deba@378 | 8 |
|
deba@378 | 9 |
int main() { |
deba@627 | 10 |
ListGraph g; |
deba@627 | 11 |
for (int i = 0; i < 10; ++i) { |
deba@627 | 12 |
ListGraph::Node node = g.addNode(); |
deba@627 | 13 |
} |
deba@674 | 14 |
ListGraph::NodeMap<int> map(g); |
deba@627 | 15 |
for (int i = 0; i < 10; ++i) { |
deba@627 | 16 |
ListGraph::Node node = g.addNode(); |
deba@627 | 17 |
map[node] = rand()%100; |
deba@627 | 18 |
} |
deba@627 | 19 |
for (ListGraph::NodeIt it(g); g.valid(it); g.next(it)) { |
deba@627 | 20 |
cout << map[it] << endl; |
deba@627 | 21 |
} |
deba@627 | 22 |
return 0; |
deba@378 | 23 |
} |
deba@378 | 24 |