-
Notifications
You must be signed in to change notification settings - Fork 20k
Add Topological Sort algorithm using DFS in GraphSearch #6263
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?
Add Topological Sort algorithm using DFS in GraphSearch #6263
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6263 +/- ##
============================================
- Coverage 74.07% 74.06% -0.01%
+ Complexity 5351 5350 -1
============================================
Files 677 677
Lines 18648 18648
Branches 3621 3621
============================================
- Hits 13813 13812 -1
Misses 4276 4276
- Partials 559 560 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hello maintainers! This PR is ready for review — all checks are passing. Please let me know if any changes are needed. Thank you! 😊 |
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.
Isn't the topological sorting already implemented in src/main/java/com/thealgorithms/sorts/TopologicalSort.java ?
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.
Oh You're right — I overlooked that it's already implemented in the sorts directory. Thanks for pointing that out.
Would you prefer that I close this PR, or is there a way I could contribute/improve the existing implementation?
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.
The existing implementation in com.thealgorithms.sorts.TopologicalSort is already a robust.
If you'd like to contribute, a great way would be to add unit tests for that class in the existing test suite or look into possible performance optimizations. @Saipatnaik-23
<arg>-Xlint:-auxiliaryclass</arg> | ||
<arg>-Werror</arg> | ||
</compilerArgs> | ||
<release>21</release> |
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.
@siriak what's your opinion on this one?
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.
The existing implementation in com.thealgorithms.sorts.TopologicalSort is already a robust.
If you'd like to contribute, a great way would be to add unit tests for that class in the existing test suite or look into possible performance optimizations. @Saipatnaik-23
649d814
to
e79ab50
Compare
e79ab50
to
2c80f84
Compare
Hello @DenizAltunkapan Added new test cases for empty and single-node graphs in the existing src/main/java/com/thealgorithms/sorts/TopologicalSort.java . Please review. Thanks! |
Description
This PR adds an implementation of Topological Sort using Depth-First Search (DFS) in Java under
com.thealgorithms.graphsearch
.main
Checklist
clang-format -i --style=file path/to/your/file.java
let me know if improvements are needed. 😊