I highly value "Programming Pearls" by Jon Bentley in this regard. He proposes a problem and then solves it in naive way followed by the right way/ways. I realized the importance of choosing correct data structure for a particular problem from that book.