Locating the Smallest Entry in an Array
In this lesson, we will search an array for its smallest value and then learn the index at which this value occurs.
We'll cover the following...
When the entries in an array can be compared with each other, we can find the smallest (or largest) among them. We either can report the value of that entry or give only its location in the array, that is, its index.
Finding the smallest entry in an array
For example, let’s consider an array data
of numberCount
positive integers. We know that we can compare one integer with another one. Let’s assume that ...