add another meath of breadth first search

this uses the visitor concept