This is a beta version of Practice-It. Give us feedback

logo Practice-It logo

BinaryTreeTraversal

Language/Type: Java binary trees tree traversals
Author: Stuart Reges (on 2020/11/06)

Consider the following tree.

                                 +---+
                                 | 4 |
                                 +---+
                               /       \
                             /           \
                       +---+               +---+
                       | 2 |               | 1 |
                       +---+               +---+
                      /     \             /     \
                     /       \           /       \
                  +---+     +---+     +---+     +---+
                  | 7 |     | 3 |     | 8 |     | 5 |
                  +---+     +---+     +---+     +---+
                       \         \             /
                        \         \           /
                       +---+     +---+     +---+
                       | 9 |     | 6 |     | 0 |
                       +---+     +---+     +---+

Fill in each of the traversals below:

pre-order
in-order
post-order

You must log in before you can solve this problem.


Log In

If you do not understand how to solve a problem or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect problems/tests, etc.), please

Is there a problem? Contact a site administrator.