Skip to content

Commit 834850e

Browse files
Fix method name to follow Java naming conventions (MaxMatching → maxMatching)
1 parent 02d4cb0 commit 834850e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/thealgorithms/dynamicprogramming/TreeMatching.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public int getMaxMatching(int root, int parent) {
4141
if (root < 0 || root >= graph.size()) {
4242
throw new IllegalArgumentException("Invalid root: " + root);
4343
}
44-
MaxMatching(root, parent);
44+
maxMatching(root, parent);
4545
return Math.max(dp[root][0], dp[root][1]);
4646
}
4747

@@ -52,7 +52,7 @@ public int getMaxMatching(int root, int parent) {
5252
* @param node The index of the current node for which the matching is calculated.
5353
* @param parent The index of the parent node (to avoid revisiting the parent node during recursion).
5454
*/
55-
private void MaxMatching(int node, int parent) {
55+
private void maxMatching(int node, int parent) {
5656
dp[node][0] = 0;
5757
dp[node][1] = 0;
5858

@@ -61,7 +61,7 @@ private void MaxMatching(int node, int parent) {
6161
if (adjNode == parent) {
6262
continue;
6363
}
64-
MaxMatching(adjNode, node);
64+
maxMatching(adjNode, node);
6565
sumWithoutEdge += Math.max(dp[adjNode][0], dp[adjNode][1]);
6666
}
6767

0 commit comments

Comments
 (0)