Insertion sort stops working after million input
Your program is running in O(n²) time, since you have two nested loops that both depend on the size of the input. So once you go from 10,000 to 1,000,000 elements, your program will take 100² = ten thousand times longer to complete. Furthermore, it can be that your dataset fit in the processor’s cache … Read more