Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. BEGIN {
  2. int visited[node_t];
  3.  
  4. int visit(node_t n, edge_t e) {
  5. if (visited[n] == 0) {
  6. visited[n] = 1;
  7.  
  8. for (e = fstin(n); e; e = nxtin(e)) {
  9. visit(e.tail, NULL);
  10. }
  11.  
  12. printf("%s\n", n.name);
  13. }
  14.  
  15. return 0;
  16. }
  17. }
  18.  
  19. N {
  20. visit($, NULL);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement