This is a simple problem of calculating maximum. This is how you do it, you take a variable max and give it a value of the first element assuming that it is the maximum. Then you loop over array and check if there is one grater than the current maximum, if there is , then you update the value of MAX and also keep track of the position.
No comments:
Post a Comment