As given above , the algorithm for simplicity employs depth - first search .
It could just as well use breadth - first search as long as the post-order property is preserved .
As given above , the algorithm for simplicity employs depth - first search , but it could just as well use breadth - first search as long as the post-order property is preserved .