Skip to content

DFS task#7

Open
stuffacc wants to merge 1 commit intomainfrom
t8_DFS
Open

DFS task#7
stuffacc wants to merge 1 commit intomainfrom
t8_DFS

Conversation

@stuffacc
Copy link
Owner

@stuffacc stuffacc commented Dec 4, 2025

No description provided.

@stuffacc stuffacc requested a review from chernishev December 4, 2025 19:52
return visited

def __iter__(self):
return self

Choose a reason for hiding this comment

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

здесь должна быть подготовка к итерации дальнейшей.

Comment on lines +7 to +20
self.add_vertex("A")
self.add_vertex("B")
self.add_vertex("C")
self.add_vertex("D")
self.add_vertex("E")
self.add_vertex("F")

self.add_edge("A", "B")
self.add_edge("A", "C")
self.add_edge("A", "D")

self.add_edge("B", "C")

self.add_edge("C", "D")

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