当前位置:网站首页>力扣刷题 101. 对称二叉树
力扣刷题 101. 对称二叉树
2022-04-23 13:54:00 【Candy_Rainbow_】
var isSymmetric = function(root) {
const isTrue = (left, right) => {//左右子树是不是镜像
if(left == null && right == null)return true;//走到了根节点
if(left == null || right == null)return false;//左右子树有一个不空
if(left.val != right.val)return false;//对称点相等不相等
return isTrue(left.left, right.right) && isTrue(left.right, right.left);//子问题
}
if(root == null)return true;
return isTrue(root.left, root.right);
};
版权声明
本文为[Candy_Rainbow_]所创,转载请带上原文链接,感谢
https://blog.csdn.net/Candy_Rainbow_/article/details/124350738
边栏推荐
- 解决方案架构师的小锦囊 - 架构图的 5 种类型
- Window function row commonly used for fusion and de duplication_ number
- [machine learning] Note 4. KNN + cross validation
- Android interview theme collection
- UNIX final exam summary -- for direct Department
- Decentralized Collaborative Learning Framework for Next POI Recommendation
- PG SQL intercepts the string to the specified character position
- 2021年秋招,薪资排行NO
- Modification of table fields by Oracle
- Processing of ASM network not automatically started in 19C
猜你喜欢

Jenkins construction and use

The art of automation

Postman reference summary
![MySQL [SQL performance analysis + SQL tuning]](/img/71/2ca1a5799a2c7a822158d8b73bd539.png)
MySQL [SQL performance analysis + SQL tuning]

ACFs file system creation, expansion, reduction and other configuration steps

The query did not generate a result set exception resolution when the dolphin scheduler schedules the SQL task to create a table
![MySQL [acid + isolation level + redo log + undo log]](/img/52/7e04aeeb881c8c000cc9de82032e97.png)
MySQL [acid + isolation level + redo log + undo log]

【报名】TF54:工程师成长地图与卓越研发组织打造

Solution of discarding evaluate function in surprise Library

Information: 2021 / 9 / 29 10:01 - build completed with 1 error and 0 warnings in 11S 30ms error exception handling
随机推荐
19c environment ora-01035 login error handling
Oracle RAC database instance startup exception analysis IPC send timeout
Oracle defines self incrementing primary keys through triggers and sequences, and sets a scheduled task to insert a piece of data into the target table every second
Basic SQL query and learning
Multithreading
Handling of high usage of Oracle undo
Information: 2021 / 9 / 29 10:01 - build completed with 1 error and 0 warnings in 11S 30ms error exception handling
leetcode--357. 统计各位数字都不同的数字个数
Use future and countdownlatch to realize multithreading to execute multiple asynchronous tasks, and return results after all tasks are completed
Atcoder beginer contest 248c dice sum (generating function)
cnpm的诡异bug
PG library checks the name
JS brain burning interview question reward
Apache seatunnel 2.1.0 deployment and stepping on the pit
[code analysis (6)] communication efficient learning of deep networks from decentralized data
Oracle renames objects
Ora-600 encountered in Oracle environment [qkacon: fjswrwo]
freeCodeCamp----time_ Calculator exercise
Kettle--控件解析
Detailed explanation of Oracle tablespace table partition and query method of Oracle table partition