Description Usage Arguments Details Value Examples
It takes an array as input and it spills out three values: the value of sum, the start and the end indexes in the original array
1 | kadane_solution(v)
|
v |
an array of length n>0 |
The time complexity of this function is linear
globalMax |
the sum of subarray found by the function |
start |
the starting index of the subarray in the original array |
end |
the ending index of the subarray in the original array |
1 | kadane_solution(c(0, -5, 7, -5, 15, 10, -8, 9, -5))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.