> On the rare occasion that I need to use a data structure or an algorithm to optimize for Time Space complexity, I'll either use a community built package or a language level feature. I'll never invent my own because whatever I come up with will be half baked anyway.
In these cases you recognized you needed to use a specific algorithm or data structure and was aware of it's existence, name and properties. That's most of the work.
Contrast this with code where common data structures are re-implemented (I need a dictionary and all I know is an array, better iterate and compare the keys until I find the right thing). And that's only scratching the surface of bad code, believe me.
In these cases you recognized you needed to use a specific algorithm or data structure and was aware of it's existence, name and properties. That's most of the work.
Contrast this with code where common data structures are re-implemented (I need a dictionary and all I know is an array, better iterate and compare the keys until I find the right thing). And that's only scratching the surface of bad code, believe me.