Skip to content
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

docs, test: Fit Topological Sort algorithm to contributing guidelines #2835

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

Conversation

HarshilShah1804
Copy link
Contributor

Description of Change

Added namespaces and updated existing documentation and tests to fit current guidelines

Checklist

  • Added description of change
  • Added tests and example, test must pass
  • Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes:

graph::addEdge(adj_1, 3, 1);
graph::addEdge(adj_1, 4, 1);
std::vector<int> ans_1 = graph::topological_sort(adj_1, n_1);
std::vector<int> expected_1 = {5, 4, 2, 3, 1, 0};
Copy link
Collaborator

Choose a reason for hiding this comment

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

should try using std::is_sorted if possible

Copy link
Contributor Author

@HarshilShah1804 HarshilShah1804 Oct 14, 2024

Choose a reason for hiding this comment

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

@realstealthninja Can you please brief me what should I do using std::is_sorted as the topological sort of a graph is not necessary in sorted order of numbers. It depends on how edges are present in the directed graph.

Thank you

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