traverse the array ...take two variables min and max ... and update them
...while traversing.....
finally min will contain the most negative value,,, and max will contain the
most positive vale... do max-min.. that will be S

On Mon, Jun 21, 2010 at 5:38 PM, amit <amitjaspal...@gmail.com> wrote:

> There is an integer array consisting positive and negative integers.
> Find maximum positive difference S defined as:
>
> S = a[i] - a[j] where i>j
> and
> S > 0
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
With Regards,
Jalaj Jaiswal
+919026283397
B.TECH IT
IIIT ALLAHABAD

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to