当前位置:网站首页>Leetcode101. Symmetric binary tree
Leetcode101. Symmetric binary tree
2022-07-28 22:55: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));
}
}
边栏推荐
- STM32_ Hal library driven framework
- Qt+ffmpeg environment construction
- 芯华章宣布完成超2亿A轮融资,全面布局EDA2.0研发
- OSV_ q Expected all tensors to be on the same device, but found at least two devices, cuda:0
- Es learning directory
- Configuration and official document of Freia library [tips]
- Record a question about the order of trigonometric function exchange integrals
- 《Robust and Communication-Efficient Federated Learning From Non-i.i.d. Data》论文阅读
- 776. String shift inclusion problem
- PC side web page special effects (offset series, obtain the coordinates of the mouse in the box, pop-up drag effect, magnifying glass effect)
猜你喜欢

NPM run dev, automatically open the browser after running the project

CGLIb 创建代理

WinForm jump to the second form case

高等数学解题常用公式笔记总结

OSV_ q AttributeError: ‘numpy. ndarray‘ object has no attribute ‘clone‘
![MKD [anomaly detection: knowledge disruption]](/img/15/10f5c8d6851e94dac764517c488dbc.png)
MKD [anomaly detection: knowledge disruption]

JVM -- custom class loader

How to delete and remove the first row of elements in PHP two-dimensional array

Annaconda installs pytoch and switches environments

Shell script foundation - shell operation principle + variable and array definitions
随机推荐
How to use sprintf function
Vscode ROS configuration GDB debugging error record
简单的es高亮实战
Improvement 14 of yolov5: replace the backbone network C3 with the lightweight network GhostNet
STM32 - DMA direct memory access controller (cubemx configures DMA)
1.8tft color screen test code (stm32f407ve)
Yolov5 improvement 15: network lightweight method deep separable convolution
《Shortening passengers’ travel time A dynamic metro train scheduling approach using deep reinforcem》
770. Word replacement
【数据库】
PC side web page effects (client series, scroll series, immediate function execution, sidebar effects)
无代码开发平台管理后台入门教程
Simple es highlight practice
Bluetooth smart Bracelet system based on STM32 MCU
Improvement 11 of yolov5: replace backbone network C3 with lightweight network mobilenetv3
Stm32+ four pin OLED screen + Chinese character mold taking
Annaconda installs pytoch and switches environments
Improvement 16 of yolov5: replace backbone network C3 with lightweight network pp-lcnet
JSON file to PNG image (batch conversion / image naming / migration / pixel value change) [tips]
从 IPv4 向 IPv6 的迁移