One of the marginal comments states: “The visitor approach allows you to separate how the traversal is done from what is done.” Is this not also true of the iterator approach?

What will be an ideal response?

No, the iterator approach will give you a reference to the node, but it is up to you to do something with it, be that printing it or storing it somewhere or something else.

Computer Science & Information Technology

You might also like to view...

The first letter of each word is capitalized in ________ case

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Operator _____________ can be used to downcast base-class pointers safely.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology