13
votes
5answers
742 views

How to perform a depth-first preorder traversal of an expression?

Due to confusion of terminology on my part I asked the wrong question before. Since it has already received other answers I shall not edit it, but instead ask the question I meant to in the first ...
17
votes
6answers
681 views

How to perform a breadth-first traversal of an expression?

Mathematica provides functions that perform a depth-first traversal on an expression, including: Map, MapAll, and ...