You are viewing a single comment's thread. Return to all comments →
No need in 2).
Min should always default to max.
In this example: int min = INT_MAX;
Then compare abs of all consecutive pairs to min.
Seems like cookies are disabled on this browser, please enable them to open this website
Minimum Absolute Difference in an Array
You are viewing a single comment's thread. Return to all comments →
No need in 2).
Min should always default to max.
In this example: int min = INT_MAX;
Then compare abs of all consecutive pairs to min.