The Crossover: O(N²) Can Be Faster for Small N

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.

Sources

Open the full topic