The former preliminarily adds all numbers to the array but only keeps the small ones.
As long as you don't look at the small_numbers[smlen] element after the loop, they behave identically.
The former preliminarily adds all numbers to the array but only keeps the small ones.
As long as you don't look at the small_numbers[smlen] element after the loop, they behave identically.