Skip to content

字节&Leetcode 199. 二叉树的(左)右视图 #172

Description

@mameikagou

题目链接:https://leetcode.cn/problems/binary-tree-right-side-view/description/
给定一个二叉树的 根节点 root,想象自己站在它的右侧,按照从顶部到底部的顺序,返回从右侧所能看到的节点值。

输入:root = [1,2,3,null,5,null,4]
输出:[1,3,4]
image

输入:root = [1,2,3,4,null,null,null,5]
输出:[1,3,4,5]
image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions