Skip to content

Conversation

sairamsharan
Copy link

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

@codecov-commenter
Copy link

codecov-commenter commented Oct 10, 2025

Codecov Report

❌ Patch coverage is 76.56250% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.33%. Comparing base (f0fb971) to head (ef458a2).
⚠️ Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
...a/com/thealgorithms/graph/HierholzerAlgorithm.java 76.56% 5 Missing and 10 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6726      +/-   ##
============================================
+ Coverage     76.80%   77.33%   +0.52%     
- Complexity     6047     6189     +142     
============================================
  Files           719      722       +3     
  Lines         20342    20653     +311     
  Branches       3940     4010      +70     
============================================
+ Hits          15624    15971     +347     
+ Misses         4127     4060      -67     
- Partials        591      622      +31     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sairamsharan sairamsharan force-pushed the feat-hierholzer-algorithm branch from cc180be to 568913c Compare October 11, 2025 06:36
@sairamsharan sairamsharan force-pushed the feat-hierholzer-algorithm branch from d24cf14 to 96bd4fc Compare October 11, 2025 07:01
Copy link
Member

@DenizAltunkapan DenizAltunkapan left a comment

Choose a reason for hiding this comment

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

@sairamsharan Thank you for your contribution. Please remove ChatGPT-like "FINAL FIX" comments.

import java.util.Map;
import java.util.Set;
import java.util.Stack;

Copy link
Member

Choose a reason for hiding this comment

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

Please add proper JavaDoc comments explaining this algorithm, its purpose, and expected input (e.g., undirected graph), similar to other classes in the repository.


private final Map<Integer, LinkedList<Integer>> graph;

public HierholzerAlgorithm(Map<Integer, LinkedList<Integer>> graph) {
Copy link
Member

Choose a reason for hiding this comment

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

Consider mentioning in JavaDoc that an undirected graph is expected, if it is so.

tempGraph.get(nextVertex).remove(Integer.valueOf(currentVertex));
currentPath.push(nextVertex);
} else {
circuit.add(0, currentPath.pop());
Copy link
Member

Choose a reason for hiding this comment

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

Consider using LinkedList.addFirst() for better performance.


dfs(startNode, visited);

// FINAL FIX: Use entrySet for efficiency.
Copy link
Member

Choose a reason for hiding this comment

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

why "FINAL FIX:" ? I think this comment might be confusing...

List<Integer> circuit = new LinkedList<>();

int startVertex = -1;
// FINAL FIX: Use entrySet for efficiency.
Copy link
Member

Choose a reason for hiding this comment

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

why "FINAL FIX:" ? I think this comment might be confusing...

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.

3 participants