CS 3.2. (ALEVEL) Tree-Traversal Flashcards

(3 cards)

1
Q

Pre-order

A
  • used for copying a tree
  • visits node when it passes left of it
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In-order

A
  • only for binary trees
    -Visits nodes when it passes the bottom of the node
  • a function of In-order is outputting in alphabetical order
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Post-order

A
  • useful for infix to RPN conversions (PMT has an example)
  • visits nodes when it passes the right of the node
How well did you know this?
1
Not at all
2
3
4
5
Perfectly