02/21/00
COM1100 Winter2000 Yuhong Yin
7
Function smallestIndex
n// return the index of the smallest value
n// startIndex indicates the starting element
nint smallestElement(int list[], int size, int startIndex) {
n int smallIndex = startIndex;
n
n for (int i = startIndex + 1; i < size; i++) {
n if (list[smallIndex] > list[i])
n smallIndex = i;
n }
n return smallIndex;
n}
n