Skip to content

Домашнее задание 10. Обход в глубину. Разгуляева А.И. #9

Open
ada1ra wants to merge 2 commits intomainfrom
hw_10_dfs
Open

Домашнее задание 10. Обход в глубину. Разгуляева А.И. #9
ada1ra wants to merge 2 commits intomainfrom
hw_10_dfs

Conversation

@ada1ra
Copy link
Owner

@ada1ra ada1ra commented Nov 27, 2025

No description provided.


def dfs(self, start_vertex=None):
"""
Обход графа в глубину | Depth-first search | DFS

Choose a reason for hiding this comment

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

ну такое постыдились бы оставлять, явно же LLM

if vertex not in visited:
visited.append(vertex)
# добавляем в обратном порядке для сохранения естественного порядка
for neighbor in reversed(self.connections_list[vertex]):

Choose a reason for hiding this comment

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

Зачем? Зачем эти лишние операции? И что такое естественный порядок?

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