-
Notifications
You must be signed in to change notification settings - Fork 6
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
base: master
Are you sure you want to change the base?
Conversation
E2: dfs v2 E2: manim dfs E2: usunięcie graphviz E2: no-invert
} | ||
``` | ||
|
||
I jak zadziała na poniższym grafie: |
There was a problem hiding this comment.
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)").
There was a problem hiding this comment.
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); | ||
``` |
There was a problem hiding this comment.
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ą.
There was a problem hiding this comment.
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.
Co-authored-by: lduraj <[email protected]>
Co-authored-by: lduraj <[email protected]>
No description provided.