Skip to content

E2: DFS i sortowanie topoligiczne #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

E2: DFS i sortowanie topoligiczne #20

wants to merge 9 commits into from

Conversation

greg19
Copy link
Collaborator

@greg19 greg19 commented Jan 11, 2025

No description provided.

@greg19 greg19 added the lekcja Nowa lekcja label Jan 11, 2025
E2: dfs v2

E2: manim dfs

E2: usunięcie graphviz

E2: no-invert
@greg19 greg19 marked this pull request as ready for review January 26, 2025 11:59
@greg19 greg19 requested review from lduraj and tonowak January 26, 2025 11:59
}
```

I jak zadziała na poniższym grafie:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do niezobowiązującego rozważenia: jako część animacji również numery wierzchołków i aktualny stan stosu wywołań rekurencyjnych (np. w postaci "DFS(1) -> DFS(2) -> DFS(4)").

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

To będzie wymagać trochę wysiłku implementacyjnego, ale mogę spróbować

```cpp
for (int v = 0; v < n; v++)
dfs(v);
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

Brakuje mi choćby jednozdaniowego argumentu, że DFS jest właśnie tym, czego potrzebujemy, żeby dostać kolejność topologiczną.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Trochę przepisałem algorytm aby był łatwiejszy do wytłumaczenia i dodałem dwa zdania wyjaśnienia. Tutaj trochę jest problem z tym, że DFS zapewnia warunek posortowania bardzo "lokalnie", patrząc na każdą krawędź, co jest zawsze trudne dla licealistów.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lekcja Nowa lekcja
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants