a recursive method have been discussed. In this post an iterative method has been discussed. The idea is to perform iterative level order traversal of the binary tree using queue. While traversing keep max variable which stores the maximum element of the current level of the tree being processed. When the level is completely traversed, print that max value.
Largest value in each level of Binary Tree Set-2 (Iterative Approach) : https://www.geeksforgeeks.org/largest-value-level-binary-tree-set-2-iterative-approach/