To explain the problem, say we have the following tree:
And we want to store elements at every level in a separate list. For this example, we would have the following three lists:
4 5 6 7
We will use the usual BFS algorithm but with a small modification. To know the level,...