Skip to content

108. Convert Sorted Array to Binary Search Tree#24

Open
MA-yo-TA wants to merge 1 commit into
mainfrom
108-Convert-Sorted-Array-to-Binary-Search-Tree
Open

108. Convert Sorted Array to Binary Search Tree#24
MA-yo-TA wants to merge 1 commit into
mainfrom
108-Convert-Sorted-Array-to-Binary-Search-Tree

Conversation

@MA-yo-TA

@MA-yo-TA MA-yo-TA commented Jul 8, 2026

Copy link
Copy Markdown
Owner

@MA-yo-TA MA-yo-TA changed the title step1,2,3 108. Convert Sorted Array to Binary Search Tree Jul 8, 2026
```python
class Solution:
def sortedArrayToBST(self, nums: list[int]) -> Optional[TreeNode]:
def interval_to_BST(head, tail) -> Optional[TreeNode]:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

head と tail は、リンクトリストの先頭と末尾のノードを表す単語だと思います。先頭のインデックスと末尾の次のインデックスを表す場合には、あまり使わないように思います。 begin/end はいかがでしょうか?

@MA-yo-TA MA-yo-TA Jul 9, 2026

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

head と tail は、リンクトリストの先頭と末尾のノードを表す単語だと思います。先頭のインデックスと末尾の次のインデックスを表す場合には、あまり使わないように思います。

ありがとうございます。

そうでしたか。
確かに他の方のコードでは left/right や start/end, begin/end がよく出てきていました。

begin/end を使うようにします。

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