Solve leetcode's bottom up level by level tree traversal using BFS.