• 重建二叉树


    输入一棵二叉树前序遍历和中序遍历的结果,请重建该二叉树。

    注意:

    • 二叉树中每个节点的值都互不相同;
    • 输入的前序遍历和中序遍历一定合法;

    样例

    给定:
    前序遍历是:[3, 9, 20, 15, 7]
    中序遍历是:[9, 3, 15, 20, 7]
    
    返回:[3, 9, 20, null, null, 15, 7, null, null, null, null]
    返回的二叉树如下所示:
        3
       / 
      9  20
        /  
       15   7
    
  • 相关阅读:
    JavaScript
    monkeyrunner总结
    repo简介
    android4.4 settings 中控制卡1 卡2都振动
    卡1卡2设置不同的默认铃声
    获取布局 ActionBar
    android Settings 解析
    设置应用中出现NFC服务,去掉
    判断当前网络显示运营商
    设置中默认铃声 通知 闹钟等
  • 原文地址:https://www.cnblogs.com/-jiuqi/p/13399775.html
Copyright © 2020-2023  润新知