You got me curious there. Do you have any resource recommendation to learn about the cost of different data structures/algos and such?
With that said I highly recommend the classic Introduction to Algorithms (CLRS for short) by Cormen et Al. It is written in clear and straightforward language. And the lectures on MIT OCW by Erik Demaine are outstanding.
By reading and watching the lectures I deeply understood stuff that I had just muddled through previously.
at my first programming job (now almost 30 years ago), I remember implementing the red-black tree algorithms in C from that book. It is chock full of really useful ideas that will make your systems better.