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 does %2f mean in c?
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
Why is c faster?
Explain how do you determine the length of a string value that was stored in a variable?
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
Explain what is the difference between far and near ?
What are the benefits of organizational structure?
What are types of preprocessor in c?
What is the use of define in c?
What is call by reference in functions?
ATM machine and railway reservation class/object diagram
Write a program to reverse a given number in c language?
Explain goto?
What are the string functions? List some string functions available in c.
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above