Skip to content

323. Number of Connected Components in an Undirected Graph#19

Open
rimokem wants to merge 1 commit into
mainfrom
0323-number-of-connected-components-in-an-undirected-graph
Open

323. Number of Connected Components in an Undirected Graph#19
rimokem wants to merge 1 commit into
mainfrom
0323-number-of-connected-components-in-an-undirected-graph

Conversation

@rimokem
Copy link
Copy Markdown
Owner

@rimokem rimokem commented Apr 13, 2026

Comment thread 0323/memo.md
visited = [False] * n

def explore_connected_nodes(start_node: int) -> None:
to_visit = [start_node]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

to_visitの名前の付け方が、よくわからなかったです。
toというよりも、from?

candidatesとつけている方も多い印象です。
僕なら、connected_nodesとつけるのもいいかなと思います。

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.

「これから訪れる座標」という意図でto_visitを使いました(他の方のコメントの受け売りです)。

個人的にはconnected_nodesは分かりやすいと思ったので、今後参考にさせていただきます。

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