File tree 1 file changed +0
-2
lines changed
src/main/java/com/thealgorithms/dynamicprogramming
1 file changed +0
-2
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ private MaximumSumOfNonAdjacentElements() {
14
14
* Approach 1: Uses a dynamic programming array to store the maximum sum at each
15
15
* index. Time Complexity: O(n) - where n is the length of the input array.
16
16
* Space Complexity: O(n) - due to the additional dp array.
17
- *
18
17
* @param arr The input array of integers.
19
18
* @return The maximum sum of non-adjacent elements.
20
19
*/
@@ -49,7 +48,6 @@ public static int getMaxSumApproach1(int[] arr) {
49
48
* of an array. Time Complexity: O(n) - where n is the length of the input
50
49
* array. Space Complexity: O(1) - as it only uses constant space for two
51
50
* variables.
52
- *
53
51
* @param arr The input array of integers.
54
52
* @return The maximum sum of non-adjacent elements.
55
53
*/
You can’t perform that action at this time.
0 commit comments