Traversing the nodes of the binary tree layer by layer