当前位置:网站首页>LeetCode 100. The same tree (simple)
LeetCode 100. The same tree (simple)
2022-08-10 05:56:00 【Shengxin Research Ape】
python recursion
# Definition for a binary tree node.# class TreeNode:# def __init__(self, val=0, left=None, right=None):# self.val = val# self.left = left# self.right = rightclass Solution:def isSameTree(self, p: Optional[TreeNode], q: Optional[TreeNode]) -> bool:if(p==None and q==None):return Trueif(p==None or q==None):return Falseif(p.val !=q.val):return Falsereturn self.isSameTree(p.left,q.left) and self.isSameTree(p.right,q.right)
边栏推荐
猜你喜欢
机器学习——聚类——商场客户聚类
PyTorch 之 可视化网络架构
Machine Learning - Clustering - Shopping Mall Customer Clustering
generic notes()()()
LeetCode 100.相同的树(简单)
Chained Picks: Starbucks looks at digital collectibles and better engages customers
I use this recruit let the team to improve the development efficiency of 100%!
Notes for Netual Network
String common methods
视图【】【】【】【】
随机推荐
The latest and most complete digital collection sales calendar-07.26
pytorch-05.用pytorch实现线性回归
深度学习TensorFlow入门环境配置
Smart contracts and DAPP decentralized applications
GUI_AWT
The complex "metaverse" will be interpreted for you, and the Link Reading APP will be launched soon!
win12 modify dns script
Copy large files with crontab
LeetCode 剑指offer 10-I.斐波那契数列(简单)
Timer (setInterval) on and off
我不喜欢我的代码
.NET操作Excel高效低内存的开源框架 - MiniExcel
索引笔记【】【】
Batch add watermark to pictures batch scale pictures to specified size
微信小程序-小程序的宿主环境
MySQL中MyISAM为什么比InnoDB查询快
离散数学的学习记录
Count down the six weapons of the domestic interface collaboration platform!
符号表
.Net Core imports tens of millions of data to Mysql