r/AskProgramming • • Apr 13 '25

What was a topic in CS/Programming that when you learned about, made you go "Damn, this is so clever!"?

227 Upvotes

274 comments sorted by

View all comments

1

u/TenYearsOfLurking Apr 16 '25

anything that makes a naive O(n²) problem a O(n log n) one.

I was completely blown away by the performance difference on e.g. sorting algorithms once the problem size becomes big

1

u/TenYearsOfLurking Apr 16 '25

I should clarify: any solution that reduces the complexity category in relation to what my intiutive solution would be