Class MaxSum
java.lang.Object
topics.divideconquer.MaxSum
DIVIDE AND CONQUER PROBLEM: MAXIMUM SUMMATION
OF ALL THE SUBSEQUENCES OF n ELEMENTS
- Author:
- vicegd
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
MaxSum
public MaxSum()
-
-
Method Details
-
maxSum1
public int maxSum1(int[] v) This algorithms is iterative. It is cubic O(n^3)- Parameters:
v- Vector to calculate the values- Returns:
- The maximum sum of the subsequences
-
maxSum2
public int maxSum2(int[] v) This algorithms is iterative. It is quadratic O(n^2)- Parameters:
v- Vector to calculate the values- Returns:
- The maximum sum of the subsequences
-
maxSum3
public int maxSum3(int[] v) This algorithms is recursive. It is DandC by division with a=2,b=2,k=1 - O(nlogn)- Parameters:
v- Vector to calculate the values- Returns:
- The maximum sum of the subsequences
-