十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
#includeusing namespace std;
struct node {
int data;
node *lc, *rc;
};
bool maxtop(node* root) {
bool flag = true;
if (!root)
return true;
if (root->lc) {
if (root->lc->data >= root->data)
return false;
else
flag = maxtop(root->lc);
if (flag == false)
return false;
}
if (root->rc) {
if (root->rc->data >= root->data)
return false;
else
flag = maxtop(root->rc);
if (flag == false)
return false;
}
return flag;
}
int main() {
struct node* bb = new node{1, NULL, NULL};
struct node* b = new node{10, NULL, bb};
struct node* c = new node{10, NULL, NULL};
struct node* a = new node{20, b, c};
cout<< maxtop(a);
return 0;
}
你是否还在寻找稳定的海外服务器提供商?创新互联www.cdcxhl.cn海外机房具备T级流量清洗系统配攻击溯源,准确流量调度确保服务器高可用性,企业级服务器适合批量采购,新人活动首月15元起,快前往官网查看详情吧