题目如下:

解题思路:凑数题+2,做完先序做后序。凑数博+2。

代码如下:

class Solution(object):def postorder(self, root):""":type root: Node:rtype: List[int]"""if root == None:return []res = []stack = [root]while len(stack) > 0:node = stack.pop(0)res.insert(0,node.val)for i in node.children:stack.insert(0, i)return res

转载于:https://www.cnblogs.com/seyjs/p/9397687.html

【leetcode】590. N-ary Tree Postorder Traversal相关推荐

  1. 【LeetCode】222. Count Complete Tree Nodes 解题报告(Python)

    [LeetCode]222. Count Complete Tree Nodes 解题报告(Python) 标签(空格分隔): LeetCode 作者: 负雪明烛 id: fuxuemingzhu 个 ...

  2. 【LeetCode】106. Construct Binary Tree from Inorder and Postorder Traversal

    Construct Binary Tree from Inorder and Postorder Traversal Given inorder and postorder traversal of ...

  3. 【Leetcode】431. Encode N-ary Tree to Binary Tree(困难)

    一.题目 1.题目描述 Design an algorithm to encode an N-ary tree into a binary tree and decode the binary tre ...

  4. 【LeetCode】971. Flip Binary Tree To Match Preorder Traversal

    题目地址: 971. Flip Binary Tree To Match Preorder Traversal 解析 本题是关于二叉树翻转的题目,给定一个二叉树,对于其中的一个节点的翻转定义为该节点的 ...

  5. 【LeetCode】427. Construct Quad Tree 建立四叉树

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 日期 题目地址:https://leetcode.c ...

  6. 【leetcode】654. Maximum Binary Tree

    题目如下: Given an integer array with no duplicates. A maximum tree building on this array is defined as ...

  7. 【二叉树的迭代版后序遍历】LeetCode 145. Binary Tree Postorder Traversal

    LeetCode 145. Binary Tree Postorder Traversal Solution1:递归版答案 二叉树的后序遍历递归版是很简单的,关键是迭代版的代码既难理解又难写!但听了花 ...

  8. 【leetcode】109. Convert Sorted List to Binary Search Tree

    题目如下: Given a singly linked list where elements are sorted in ascending order, convert it to a heigh ...

  9. 【LeetCode】Minimum Depth of Binary Tree 二叉树的最小深度 java

    [LeetCode]Minimum Depth of Binary Tree Given a binary tree, find its minimum depth. The minimum dept ...

最新文章

  1. Windows 日志高级筛选实践
  2. java编程时 尽量少用_Java编程语言基础知识的要点
  3. Android--SlidingDrawer的使用介绍
  4. 瑞幸咖啡百万大咖活动 记人生第一次豪赌,净赔了200元钱。
  5. 获取周一_Ace足球网冬至版周一推介
  6. 求数组所有区间最大值减去最小值之差的和(贝壳笔试题)
  7. POJ3287(BFS水题)
  8. MVC---张国亮总结心得第一季
  9. ROS 教程——从入门到入土
  10. 一种雷达和电子海图图像叠加方法
  11. 柔性电子 压力传感器 strain-pressure sensor MoS2/graphene
  12. 9:参数校验-Java Spring
  13. php调用pdf虚拟打印机,window_在Win7系统中怎么安装PDF彩色虚拟打印机?,前面说过,Word不能直接将文档 - phpStudy...
  14. win10 快速截屏
  15. iOS程序猿的flutter学习之路
  16. 江苏28岁美女法医2年内检验400具尸体(图)
  17. NEO4J实战之《阿丽塔战斗天使》
  18. Android代码实现打开打开wifi wps按钮和wps pin码输入
  19. Python tkinter+文件操作 实现学生信息管理系统
  20. 帝国empirecms后台登陆次数限制修改

热门文章

  1. Python type 函数- Python零基础入门教程
  2. linux还原windows,双系统如何删除Linux,恢复Windows从  MBR引导启动?
  3. linux 系统改名,linux改名命令
  4. python基础编程题、积分面积_Python基础编程题100列目录
  5. java spring 多数据库_java – 使用多个数据源/数据库的Spring-Hibernate
  6. python字典的建立和输出_字典的创建和使用
  7. android动画放大后缩小,Android 补间动画 scale(缩放)
  8. ecshop category.php?id=4,categoryall.php
  9. navicat fo mysql 教程_Navicat For MySQL的简单使用教程
  10. airodump-ng wlan0mon扫描不到网络_MySQL ProxySql 由于漏洞扫描导致的 PROXYSQL CPU 超高...