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
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
Suggesting that there can be 62 seconds in a minute?
What will the code below print when it is executed? int x = 3, y = 4; if (x = 4) y = 5; else y = 2; printf ("x=%d, y=%d ",x,y);
Subtract Two Number Without Using Subtraction Operator
Is main an identifier in c?
which is an algorithm for sorting in a growing Lexicographic order
write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??
What is abstract data structure in c?
What is echo in c programming?
Can you explain the four storage classes in C?
What does dm mean sexually?
Tell me the use of bit field in c language?
What does volatile do?
diff between exptected result and requirement?