当前位置:网站首页>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)
边栏推荐
- GUI_AWT
- Content related to ZigBee network devices
- opencv
- Bifrost micro synchronous database implementation services across the library data synchronization
- Decentralized and p2p networks and traditional communications with centralization at the core
- 堆的原理与实现以及排序
- pytorch-10.卷积神经网络
- tinymce rich text editor
- Chain Reading|The latest and most complete digital collection sales calendar-08.02
- I use this recruit let the team to improve the development efficiency of 100%!
猜你喜欢

pytorch-07.处理多维特征的输入

分享一款恋爱星座男女配对微信小程序源码

深度学习TensorFlow入门环境配置

The latest and most complete digital collection sales calendar-07.27

The Principle of Union Search and API Design

tinymce rich text editor

pytorch-11.卷积神经网络(高级篇)

LeetCode 292. Nim Game (Simple)

Multi-table query Notes

LeetCode 938. Range Sum of Binary Search Trees (Simple)
随机推荐
Copy large files with crontab
Collection tool class
Collection Map
pytorch-06.逻辑斯蒂回归
LeetCode 剑指offer 10-I.斐波那契数列(简单)
Timer (setInterval) on and off
The complex "metaverse" will be interpreted for you, and the Link Reading APP will be launched soon!
Set Sources Resources and other folders in the IDEA project
常用类 BigDecimal
I use this recruit let the team to improve the development efficiency of 100%!
network security firewall
ORACLE system table space SYSTEM is full and cannot expand table space problem solving process
The submenu of the el-cascader cascade selector is double-clicked to display the selected content
[Difference between el and template]
Reprint fstream, detailed usage of ifstream
pytorch-05.用pytorch实现线性回归
MySql constraints
Collection set interface
[List Exercise] Traverse the collection and sort by price from low to high,
视图【】【】【】【】