Despite its worse asymptotic growth, an O(N²) algorithm might outperform an O(N) one for small input sizes (e.g., N < 100) due to smaller constant factors or simpler operations.
Open the full topic