Skip to content

Conversation

@Satorien
Copy link
Owner

count += 1
return count

left_root, right_root = split_bst_helper(copy.deepcopy(root))
Copy link

Choose a reason for hiding this comment

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

関数の中の記述と合わせてsplit_below_v, split_above_vとしてもいいと思いました。


## Step 2. Alternatives

- LeetCode版では序盤の分割までで終わり
Copy link

Choose a reason for hiding this comment

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

ワンパスでやるならば、split_bst_helper がサイズも返すようにすればいいんですが……。
まあ、速度は速くなるかもしれませんが、複雑さに見合わない気がしますね。

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.

4 participants