Yes, that is right. But even though they ultimately boil down to an O(n) time complexity, it can still have a significant performance impact if your arrays are massive, as you said. In a way, I'm not really misleading beginners here because it's the truth of the matter.
But for most cases, one does not need to worry about these performance impacts. It really is just an unnecessary optimization.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yes, that is right. But even though they ultimately boil down to an
O(n)
time complexity, it can still have a significant performance impact if your arrays are massive, as you said. In a way, I'm not really misleading beginners here because it's the truth of the matter.But for most cases, one does not need to worry about these performance impacts. It really is just an unnecessary optimization.