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


Please Help Members By Posting Answers For Below Questions

What extern c means?

546


What does s c mean on snapchat?

589


What happens if a header file is included twice?

601


What is the difference between array and pointer in c?

582


Explain how can I pad a string to a known length?

655






What is meant by int main ()?

718


Is c still used?

605


What is c basic?

602


How are portions of a program disabled in demo versions?

752


What is the use of a semicolon (;) at the end of every program statement?

775


What is the difference between formatted&unformatted i/o functions?

618


What is the best way of making my program efficient?

572


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

1493


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

642


How can I write a function analogous to scanf?

660