#include<stack>
#include<iostream>
using namespace std;
struct Node{
int val;
Node* left;
Node* right;
Node(int val_):val(val_),left(nullptr),right(nullptr){}
};
stack<Node*> stk;
void bfs(Node* root)
{
if (!root) return;
stk.push(root);
while (!stk.empty())
{
Node* cur = stk.top();
cout <<"the val is: "<< cur->val <<endl;
stk.pop();
if (cur->left) stk.push(cur->left);
if (cur->right) stk.push(cur->left);
}
}
void dfs(Node* root)
{
if (!root) return;
cout <<"the val is: "<< root->val <<endl;
dfs(root->left);
dfs(root->right);
}