Project1.pdf

Design And Analysis Of Algorithms
Divide & Conquer
j
i
A1 , A2 ,
, AN
N
Ai + Ai+1+
1
Ai
N
+ Aj
100,000 N
i
N
S = Ai + Ai+1+
+ Aj S
j
.java
.cpp
MaxSubarraySum
i
Shell
Sample Input
10
3 1 10 -20 17 -69 139 -10 7 8
Sample Output
144
7 10
Sample Input
Sample Output
1
-100
-100
11
Sample Input
8
198 -1007 2378 678 14 -9911 8970 -15
8970
88
[email protected]
Sample Output
<Your SID>
Subject : Proj-1
Body : Your Name And Your SID
Arbiter
zip