当前位置:网站首页>牛客-TOP101-BM35
牛客-TOP101-BM35
2022-07-23 12:03:00 【一条吃猫的鱼】
import java.util.*;
/* * public class TreeNode { * int val = 0; * TreeNode left = null; * TreeNode right = null; * public TreeNode(int val) { * this.val = val; * } * } */
public class Solution {
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param root TreeNode类 * @return bool布尔型 */
public boolean isCompleteTree (TreeNode root) {
// write code here
if(root == null)
return true;
Deque<TreeNode> deque = new LinkedList<>();
deque.addLast(root);
boolean sign = false;
TreeNode t;
while(!deque.isEmpty()){
t = deque.pollFirst();
if(t == null){
sign = true;
continue;
}
if(sign)
return false;
deque.offerLast(t.left);
deque.offerLast(t.right);
}
return true;
}
}
边栏推荐
- Éléments de base de la validation des haricots - 04
- 为什么要造一个 UILabel ?( 复习两丫技术 )
- “1+1>10”:无代码/低代码与RPA技术的潜在结合
- Redis installation
- Origin of bean validation ----01
- ICML 2022 | 稀疏双下降:网络剪枝也能加剧模型过拟合?
- 再获殊荣 | OpenSCA获选中国软博会“全球十大开源软件产品”
- Class homework (5) -- 576. Hungry cattle
- sqlnet.ora文件设置不对造成ORA-12154 、ORA-01017连接异常
- MySQL表字段数量限制以及行大小限制
猜你喜欢

【云原生】持续集成和部署(Jenkins)
![[attack and defense world web] difficulty Samsung 9-point introductory question (middle): ics-05, easytornado](/img/94/5b914d0ce2a2c3e1760d1b27321479.png)
[attack and defense world web] difficulty Samsung 9-point introductory question (middle): ics-05, easytornado

js过滤/替换敏感字符

Fake XML cookbook of XML xxE vulnerability

Mysql—主从复制

MySQL-字符串按照数值排序

A quietly rising domestic software is too strong!

Bean validation beginner ----02
![[in simple terms] from self information to entropy, from relative entropy to cross entropy, nn Crossentropyloss, cross entropy loss function and softmax, multi label classification](/img/42/5419f0b3240142de87895439bd4297.png)
[in simple terms] from self information to entropy, from relative entropy to cross entropy, nn Crossentropyloss, cross entropy loss function and softmax, multi label classification

Software testing weekly (No. 81): what can resist negativity is not positivity, but concentration; What can resist anxiety is not comfort, but concrete.
随机推荐
New infrastructure of enterprise data in the era of digital transformation | love Analysis Report
满足多种按键的高性价比、高抗干扰触摸IC:VK3606D、VK3610I、VK3618I 具有高电源电压抑制比
List merging (summer vacation daily question 3)
Bean Validation起源篇----01
忘记oracle密码,如何解决
The difference between deadlock, hunger and dead cycle
[suctf 2018]multisql (MySQL precompiled)
手机使用多了可能会丢掉工作
後綴錶達式(暑假每日一題 4)
Bean Validation规范篇----03
FPGA HLS multiplier (pipeline vs. ordinary simulation)
“1+1>10”:无代码/低代码与RPA技术的潜在结合
中年危机,35岁被退休,打工人拿什么来抗衡资本家?
table自定义表格的封装
信箱通信-
On 'premature optimization'
Ultra detailed MP4 format analysis
7、 Logic of JMeter sending request
2022 the most NB JVM foundation to tuning notes, thoroughly understand Alibaba P6 small case
七、jmeter发出请求的逻辑