“最大子序列和”算法 java
maxSubSum分别是最大子序列和的4中java算法实现。
第一种算法运行时间为O(N^3),第二种算法运行时间为O(N^2),第三种算法运行时间为O(nlogn),第四种算法运行时间为线性N
测试
public class Test {
public static void main(String[] args) {
int[] a = {-2, 11, -4, 13, -5, -
原创
2014-06-24 03:36:12 ·
2966 阅读 ·
1 评论