注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号
x
本帖最后由 匿名 于 2025-3-26 23:52 编辑
First round:
Given a binary tree, return the values of the outer nodes of the tree clockwise, starting from the root node, in a list. the outer nodes are: 1. nodes visible when you look from left or right of the tree, 2. leaf nodes (nodes with no child node)
I implemented 3 recursive functio您好! 本帖隐藏的内容需要积分高于 188 才可浏览 您当前积分为 0。 使用VIP即刻解锁阅读权限或查看其他获取积分的方式 游客,您好! 本帖隐藏的内容需要积分高于 188 才可浏览 您当前积分为 0。 VIP即刻解锁阅读权限 或 查看其他获取积分的方式 f parentheses using ITERATIVE method. I can only think of the following method: iterate through number 0-2^(2n), each number bit 1 is ( and bit 0 is ). then filter invalid parentheses. Do you have a better approach? Please share it in comments.
求大米看面经 |