Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Find Min between subarray
int get_min_range(int array[], int firstSubscript, int lastSubscript)
int smallestValue = array[firstSubscript];
int smalledIndex = firstSubscript;
for (int i = firstSubscript; i <= lastSubscript; i++)
if (array[firstSubscript] < smallestValue)
smallestValue = array[firstSubscript];
smalledIndex = firstSubscript;
return smalledIndex;

This comment has been minimized.

Copy link
Owner Author

@itsaboutcode itsaboutcode commented Nov 30, 2010

Program Description

Write function "getminrange" which returns the subscript of the smallest value in a portion of an array containing type int values. It has three arguments: an array, the first subscript in the subarray, and the last subscript in the subarray.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.