Back to exercises

Binary Tree Traversals

Write a DFS helper that appends the current node before, between, or after visiting children depending on which traversal you are building.

Coding Exercises Medium O(n)

Binary Tree Traversals

Write a DFS helper that appends the current node before, between, or after visiting children depending on which traversal you are building.

Return the inorder, preorder, and postorder traversals of a binary tree.