// find maixmum node in binary tree
const Max = (root) => {
let max = -Infinity;
let stack = [root];
while (stack.length) {
let current = stack.pop();
if (current.data > max) {
max = current.data;
}
if (current.left !== null) stack.push(current.left);
if (current.right !== null) stack.push(current.right);
}
return max;
};