You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/java/com/thealgorithms/dynamicprogramming/MaxSumNonAdjacent.java
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,9 @@
19
19
Use dynamic programming to maintain a running maximum sum.
20
20
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).*/
21
21
22
+
// Problem Explaination: "https://medium.com/@amitrajit_bose/max-sum-of-non-adjacent-elements-a04ebc4f2602"
23
+
24
+
22
25
publicclassMaxSumNonAdjacent {
23
26
// This function recursively calculates the maximum possible sum
24
27
// by considering or not considering the current element.
0 commit comments