当前位置:网站首页>leetcode101. 对称二叉树
leetcode101. 对称二叉树
2022-07-28 21:10:00 【henujolly】
class Solution {
public boolean isSymmetric(TreeNode root) {
return check(root,root);
}
boolean check(TreeNode p,TreeNode q){
if(p==null&&q==null) return true;
if(p==null||q==null) return false;
return (p.val==q.val)&&(check(p.left,q.right))&&(check(p.right,q.left));
}
}
边栏推荐
- 《Shortening passengers’ travel time A dynamic metro train scheduling approach using deep reinforcem》
- 775. 倒排单词
- Yolov5 improvement 4: add ECA channel attention mechanism
- How to delete and remove the first row of elements in PHP two-dimensional array
- Qt+FFmpeg环境搭建
- hp proliant dl380从U盘启动按哪个键
- How to install and use PHP library neo4j
- Memseg [anomaly detection: embedded based]
- Lenovo r9000p installation matlab2018a+cuda10.0 compilation
- 775. Inverted words
猜你喜欢

STM32 - reset and clock control (cubemx for clock configuration)

GD32F303固件库开发(10)----双ADC轮询模式扫描多个通道

PC side web page special effects (offset series, obtain the coordinates of the mouse in the box, pop-up drag effect, magnifying glass effect)

Simple es highlight practice
![Memseg [anomaly detection: embedded based]](/img/10/aea2b6ecf55e04fe24f78e5fb897be.png)
Memseg [anomaly detection: embedded based]

LTE小区搜索过程及SCH/BCH设计

842. 排列数字

《Shortening passengers’ travel time A dynamic metro train scheduling approach using deep reinforcem》

WinForm jump to the second form case

Bluetooth smart Bracelet system based on STM32 MCU
随机推荐
Use PCL to batch convert point cloud.Bin files to.Pcd
One of the experience of solving problems with code error reporting: CUDA does not match pytorch
776. String shift inclusion problem
简单的es高亮实战
OSV_ q AttributeError: ‘numpy. ndarray‘ object has no attribute ‘clone‘
770. Word replacement
What to do after mathematical modeling gets the competition problem and some ("crooked ways") tips - must see before the competition
C语言学习内容总结
NPM run dev, automatically open the browser after running the project
Stm32subeide (10) -- ADC scans multiple channels in DMA mode
Wheel 6: qserialport serial port data transceiver
希捷发布全新RISC-V架构处理器:机械硬盘相关性能暴涨3倍
[connect your mobile phone wirelessly] - debug your mobile device wirelessly via LAN
Ocr-gan [anomaly detection: Reconstruction Based]
从 IPv4 向 IPv6 的迁移
Evaluation index of anomaly detection: rocauc et al. [tips]
Summary of C language learning content
OSV_ q Expected all tensors to be on the same device, but found at least two devices, cuda:0
Binary source code, inverse code, complement code
Improvement 13 of yolov5: replace backbone network C3 with lightweight network efficientnetv2