当前位置:网站首页>LeetCode 94. Inorder Traversal of Binary Trees (Simple)
LeetCode 94. Inorder Traversal of Binary Trees (Simple)
2022-08-10 05:54: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 inorderTraversal(self, root: Optional[TreeNode]) -> List[int]:self.list1 = []self.inorder(root)return self.list1def inorder(self,root):p = rootif(p==None):returnself.inorder(p.left)self.list1.append(p.val)self.inorder(p.right)
边栏推荐
- Using sqlplus to operate database in shell script
- 测一测异性的你长什么样?
- [Difference between el and template]
- A timeout error is reported when connecting to Nacos
- 21天挑战杯MySQL-Day05
- 数据库 笔记 创建数据库、表 备份
- 卷积神经网络(CNN)实现mnist手写数字识别
- Link reading good article: What is the difference between hot encrypted storage and cold encrypted storage?
- Collection Map
- 深度学习TensorFlow入门环境配置
猜你喜欢

机器学习——聚类——商场客户聚类

常用类 String概述

视图【】【】【】【】

符号表

LeetCode 1720.解码异或后的数组(简单)

One step ahead, don't miss it again, the chain reading APP will be launched soon!

Reflection 【Notes】

Chain Reading|The latest and most complete digital collection sales calendar-07.29

LeetCode 100.相同的树(简单)

Operation table Function usage
随机推荐
Smart contracts and DAPP decentralized applications
并查集原理与API设计
Chain Reading Good Article: Jeff Garzik Launches Web3 Production Company
堆的原理与实现以及排序
The latest and most complete digital collection sales calendar-07.26
Batch add watermark to pictures batch add background zoom batch merge tool picUnionV4.0
wiki confluence installation
文本元素
深度学习TensorFlow入门环境配置
Link reading good article: What is the difference between hot encrypted storage and cold encrypted storage?
泛型笔记()()()
pytorch-06.逻辑斯蒂回归
连接 Nacos 报超时错误
[Difference between el and template]
学生管理系统以及其简单功能的实现
最新最全的数字藏品发售日历-07.26
Linux database Oracle client installation, used for shell scripts to connect to the database with sqlplus
cesium rotate image
测一测异性的你长什么样?
链读好文:热加密存储与冷加密存储有什么区别?