There are questions of an interview that an associate asked for the programming status. I thought the interviewer was very good to see this.
Looking at a list of real numbers N, say that code>, maximum value What is the complexity of finding M, for which index 1 & lt; = I & lt; = J & lt; = N is such that If this is the classic CS problem then apologize to me. complexity is: algorithm [a_1, a_2, ..., a_N]
a_i + a_ {i + 1} + ... + a_j = m ?
(MaxSume, MaxStart Index, maxand index) . It collects a partial sum in
currentMaxSum and when it grows larger than the partial amount of
maxSum , then updates the optimal category.
Comments
Post a Comment