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 scope rule in c?
Write a program to check armstrong number in c?
What is an auto keyword in c?
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
What is array of structure in c programming?
How do you define a function?
#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }
what will be maximum number of comparisons when number of elements are given?
Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......
What does emoji p mean?
Why do we use main function?
please give me some tips for the placement in the TCS.
When should I declare a function?
How can a program be made to print the line number where an error occurs?
Define C in your own Language.