Skip to content

111. Minimum Depth of Binary Tree#21

Open
miyataka wants to merge 1 commit into
mainfrom
111_MinimumDepthOfBinaryTree
Open

111. Minimum Depth of Binary Tree#21
miyataka wants to merge 1 commit into
mainfrom
111_MinimumDepthOfBinaryTree

Conversation

@miyataka

Copy link
Copy Markdown
Owner

@miyataka miyataka changed the title 111 minimum-depth-of-binary-tree 111. Minimum Depth of Binary Tree Jun 27, 2026
// スタックオーバーフローになるかを検討するために,ざっくり計算量を見積もる.
// nodeの数は, 0 <= N <= 10^5
// Go言語だと,スタックメモリは1GB程度だったはず.あとで再確認する.
// 10^9 Byteなので,一つのスタックが10^3程度までならギリ収まりそう.スタックオーバーフローを気にしたくはないので,ループで書く

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

この問題だと、スタックフレームは1000Bより十分小さい気がします。レビューコメントを見ていると、100B程度で見積もることが多い印象です。
気にしたくないのでループで書くという選択には共感します。

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.

2 participants