umdreamer / leetcodeproblems

Solutions for LeetCode OJ
3 stars 9 forks source link

2023.5.30 Problem: 100. Same Tree #26

Closed umdreamer closed 1 year ago

umdreamer commented 1 year ago
  1. Same Tree Problem Link

Given the roots of two binary trees p and q, write a function to check if they are the same or not.

Two binary trees are considered the same if they are structurally identical, and the nodes have the same value.

Example 1: image

Input: p = [1,2,3], q = [1,2,3]
Output: true

Example 2: image

Input: p = [1,2], q = [1,null,2]
Output: false

Example 3: image

Input: p = [1,2,1], q = [1,1,2]
Output: false

Constraints:

tangyexi commented 1 year ago
屏幕截图 2023-05-30 210127
xiaolu2002 commented 1 year ago

image

huangyumei1 commented 1 year ago

QQ图片20230530213127

htywan commented 1 year ago

1

ZWJ2212061008 commented 1 year ago

image

cuixiao02 commented 1 year ago
截屏2023-05-31 11 58 43
gusuning commented 1 year ago
屏幕截图 2023-05-31 143939
zhjingyan commented 1 year ago

image

Lggg1234 commented 1 year ago

屏幕截图 2023-05-30 210327

promisewith7 commented 1 year ago

image

mafanjia commented 1 year ago

截屏100

123lrb commented 1 year ago

_G71OFK9PL0ZQ C4HA2P34K

PinkyLame commented 1 year ago

image

12baoxingyu-6 commented 1 year ago
image
sjh397 commented 1 year ago

image

liu-si-han commented 1 year ago
image
1125766961 commented 1 year ago

image

yeyuxq commented 1 year ago

image

syr2212061031 commented 1 year ago

07XQ2Y)53U(4@@@E@$94H@9

liuhuanyu6 commented 1 year ago

image

xkqwww commented 1 year ago

无标题

zxm-1235 commented 1 year ago

image

24zlx commented 1 year ago

联想截图_20230531211429

naqianqpg commented 1 year ago

H023ED57Z`O~QFXSCDB44GY

daowuwu commented 1 year ago

O_C)T~28VFNB G7$KS24WYO

zyhzxy99 commented 1 year ago

L7YNF$5S9`2RYQ)5EN72CF0

wangshiqi7 commented 1 year ago
截屏2023-05-30 20 46 22
bedauern commented 1 year ago
Snipaste_2023-05-31_22-16-53
foxbou commented 1 year ago

image

zangfushuo commented 1 year ago
截屏2023-05-31 23 31 36
shylieisme commented 1 year ago

X@GS3%JTWXN %L2S I67EJN

686xiaozhang commented 1 year ago

QQ截图20230601173847