There is already a lot of good discussion on this thread. So I will just reiterate some of the points I have seen.
Stephan van Hulst wrote:While I've never had reason to implement a linked list or a heap in the "real world", practicing with them made it faster to recognize their use in existing software, which makes reasoning about your code and tracking down bugs much easier. I also think that while many of the things you learn from your textbooks you won't apply in practice directly, you will mix and match those concepts to create solutions to real world problems.
There's two really important points here. #1 Understanding the basic data structures and algorithms is critical to understanding (and thus correctly using) other people's code, including standard libraries. #2 A lot of interesting challenges come up where a single standard algorithm won't apply, but you have to mix components of two or more.
That being said, I have had to implement algorithms and data structures. In those cases it is almost always because I have needed to adapt them to a problem that is almost, but not quite, what you find in the textbook. For example in my graduate work, I ended up adapting spatial data structures like KD-trees and Quad-Trees to work on spherical coordinates, because I was working with astronomy data.