Skip to content

Commit 7bcf2dc

Browse files
committed
Add Maximum Sum of Non-Adjacent Elements Algorithm
1 parent 98b98de commit 7bcf2dc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
Use dynamic programming to maintain a running maximum sum.
2020
For each element, decide to either include it in the sum (and skip the previous element) or exclude it (and keep the sum up to the previous element).*/
2121

22+
// Problem Explaination: "https://medium.com/@amitrajit_bose/max-sum-of-non-adjacent-elements-a04ebc4f2602"
23+
24+
2225
public class MaxSumNonAdjacent {
2326
// This function recursively calculates the maximum possible sum
2427
// by considering or not considering the current element.

0 commit comments

Comments
 (0)