If we have an array of Interger values, find out a sub array
which has a maximum value of the array and start and end
positions of the array..The sub array must be contiguious.
Take the start add to be 4000.
For Ex if we have an array arr[] =
{-1,-2,-5,9,4,3,-6,8,7,6,5,-3}
here the sub array of max would be
{8,7,6,5} coz the sum of max contiguous array is 8+7+6+5 =
26.The start and end position is 4014(8) and 4020(5).
Answer Posted / monica
Well this is not an answer to the question but the solution
given in the example is wrong. Wont the subarray that gives
the max sum be {9,4,3,-6,8,7,6,5} whose sum is 36???
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
What is difference between function overloading and operator overloading?
What are the ways to a null pointer can use in c programming language?
Is it possible to have a function as a parameter in another function?
write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34
What are header files in c?
What are the difference between a free-standing and a hosted environment?
What is signed and unsigned?
Explain what is the difference between functions abs() and fabs()?
How to delete a node from linked list w/o using collectons?
What is structure in c explain with example?
What is difference between && and & in c?
What are header files? What are their uses?
Are the variables argc and argv are local to main?
Why we use int main and void main?
What does malloc () calloc () realloc () free () do?