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 extern c means?
What does s c mean on snapchat?
What happens if a header file is included twice?
What is the difference between array and pointer in c?
Explain how can I pad a string to a known length?
What is meant by int main ()?
Is c still used?
What is c basic?
How are portions of a program disabled in demo versions?
What is the use of a semicolon (;) at the end of every program statement?
What is the difference between formatted&unformatted i/o functions?
What is the best way of making my program efficient?
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25
a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor
How can I write a function analogous to scanf?