Skip to content

Conversation

Satorien
Copy link
Owner

@Satorien Satorien commented Jun 2, 2025

return 1 + max(self.maxDepth(root.left), self.maxDepth(root.right))
```

- 他にもいくつか読んだが基本的にはBFSかDFSか、Depthをどう保持するか、Noneのチェックをどこで行うか、変数を新しく置くか、くらいの差しかなさそう
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

特に大きな問題はないのですが、読みやすい読みにくい、これは良い悪い、みたいな感情を育てて欲しいので、感情が記録してあるとコメントしやすいですね。

https://docs.google.com/document/d/11HV35ADPo9QxJOpJQ24FcZvtvioli770WWdZZDaLOfg/edit?tab=t.0#heading=h.5h10o8wgz7ah

continue
max_depth = max(max_depth, depth)
remaining_nodes_and_depths.append((node.left, depth + 1))
remaining_nodes_and_depths.append((node.right, depth + 1))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

特に問題ないと思います。
自分はNoneを入れないように更新する派です

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants