MCPcopy Create free account
hub / github.com/algorithmzuo/videocode / main

Method main

src/videocode/Code05_MaxSubArraySum.java:70–88  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

68 }
69
70 public static void main(String[] args) {
71 int maxLen = 20;
72 int maxValue = 50;
73 int testTime = 3000000;
74 System.out.println("如果没有错误信息打印,说明所有测试通过");
75 System.out.println("测试开始");
76 for (int i = 0; i < testTime; i++) {
77 int[] arr = randomArray(maxLen, maxValue);
78 int ans1 = maxSubArraySum1(arr);
79 int ans2 = maxSubArraySum2(arr);
80 int ans3 = maxSubArraySum3(arr);
81 if (ans1 != ans2 || ans1 != ans3) {
82 System.out.println("出错了!");
83 System.out.println(ans1 + " , " + ans2 + " , " + ans3);
84 break;
85 }
86 }
87 System.out.println("测试结束");
88 }
89
90}

Callers

nothing calls this directly

Calls 4

randomArrayMethod · 0.95
maxSubArraySum1Method · 0.95
maxSubArraySum2Method · 0.95
maxSubArraySum3Method · 0.95

Tested by

no test coverage detected