0

I know of the famous BFS and DFS methods for tree traversal. I have also heard of bottom up traversal as well as top down traversal when visiting an AST (related to compilers).

I cannot understand the relationship between these 2 sets, are they referring to the same methods?

  • Have you read https://en.wikipedia.org/wiki/Top-down_parsing and https://en.wikipedia.org/wiki/Bottom-up_parsing? – Jim Mischel Dec 03 '19 at 05:41

1 Answers1

0

For the first part of your question, see this answer. For the second part, we usually refer to bottom up and top down in recursivity, so it is not related to trees but to recursive calls, when it's the caller which gives intermediate result to the callee it's top down, when the caller calls the callee for a result it will use we talk about bottom up.

Ayoub Omari
  • 806
  • 1
  • 7
  • 24