I have done a lot of research on how to traverse through binary trees and I still have not found a way to traverse through a tree without going all the way to its leaves. I just want to print the binary tree one level at a time instead of using In-Order-Traversal, Pre-Order-Traversal, or Post-Order-Traversal results.
I want to print: {2, 7, 5, 2, 6, null, 9, null, null, 5, 11, 4, null}. Can I use recursion to solve this? Because it seems like I always end up at the leaves of one side before I solve for the other sides non-leaves.