Your question suggests his own answer. It depends on the source of the collection itself. That is, the more you know about the dataset, the faster you can come up with heuristics to get the answer you need.
So, if your list is already sorted, list [0] or list [len-1] will be the highest ...
The secondary answer also depends on "How often will the list be viewed?". If this is a one-time search, then simply repeating the list for the highest will be the fastest. If you do this multiple times (for example, collecting various indicators), sorting first using Quick Sort might be best.
source share