How should I deal with incorrect information given to me by a TA I'm in an introductory CS class, and we have a small project we need to complete. I was struggling, so I went to the student(undergrad) TA's office hours, and asked a couple questions which made sense to me given my understanding of the material. He seemed preoccupied with work on his computer, but when I finished a question he would look up and say something like yes, that's correct, or "I see what your saying, that's a good question," and finally "Yes, if you use that data structure you get [Horrendous run time]." (I hypothesized this in my question) As a result, I rewrote my code trying to use different data structures, and I changed the fundamental algorithms I was using. 

When my program still was not working today, I went to my professor's office hours, and ended up asking basically the same questions. It turned out that they were not, in fact, good questions, but were based on fundamental misunderstandings of the material, and in particular, the data structure I was talking about is exactly what is used and it gets a very good run time. (But my understanding of how to process the data was way off). Once my professor cleared this up, I rewrote my code and now it works.

In retrospect, I think the TA wasn't listening at all to my questions, and was just saying yes until I left. This had a serious negative impact on me, as I rewrote code that was on the right track and pored time into debugging, only to have to throw it all away.

So my question is: should I tell the professor about this, or just walk away? If it matters, the student will likely be TA again next semester.
Yes, tell the professor about it. You shouldn't make a huge deal out of it, but send a brief, neutral e-mail saying that you were given wrong information in the office hours, that you got the impression the student was distracted and not really listening to what you said, and maybe ask how you can ensure that you do not waste time on red herrings next time.

If it's a one-off, and the student just had a bad day or a pressing deadline, it shouldn't have a big impact, but if other students also report similar problems the prof may watch the TA's performance a bit more closely, and may even decide to hire a different TA next year.

End-of-semester evaluations are also a good place to note this kind of experience. In my university the TAs even get their own evaluation form.