Finished levelorderTraversal function.