I think the question you should be asking yourself is:
If I just have to find the largest and the smallest value, do I have to store all the values in memory?
I think the question you should be asking yourself is:
If I just have to find the largest and the smallest value, do I have to store all the values in memory?