", ...) do
    self[#self + 1] = select(i, ...)
  end
end

A = Node{ name = "A" }
B = Node{ name = "B" }
C = Node{ name = "C" }
D = Node{ name = "D" }

A:goesto(B,C)
B:goesto(D)
C:goesto(D)
D:goesto(A)

io.write("broad-first search:")
for node in broadsearch(A) do
  io.write(" ", node.name)
end
print()

io.write("depth-first search:")
for node in depthsearch(A) do
  io.write(" ", node.name)
end
print()
</pre>

</div>

<div class="content">
<p><small><strong>Copyright (C) 2004-2008 Tecgraf, PUC-Rio</strong><