Sorting with Loops
In automation, it is often necessary to have to figure out the range of certain characteristics of the part your machine produces. For example, it is quite common to need to know how heavy the heaviest part was or how short the shortest part was. Sorting characteristics of parts is often required in many manufacturing environments to ensure proper quality. Typically, to effectively perform the necessary statistics calculations, it is helpful to have all the data sorted.
Sorting is a vital concept in computer science. Sorting can be a very costly operation in terms of memory, CPU power, and most importantly, time. As logic dictates, the more data you have to sort through, the more time and resources you will need at your disposal. Therefore, when sorting, you have to choose an appropriate sorting methodology that is easy to implement while still being efficient enough to get the job done in a timely manner.
The key to sorting is looping. More specifically, FOR...