Home About MIT CC BY-SA 4.0 RSS

trees

Iterative Tree Node Counting

I love coding, but one of the major hurdles I haven’t been able to pass is the sluggish speed at which I actually write code – this is a death sentence during coding interviews. In order to combat this, I’ve been working on competitive programming over the last several months, with the result that I’ve seen some moderate improvement to my coding. One of the great strengths of these contests is that in addition to gaining raw speed, I’ve been exposed to a variety of data structures and algorithm implementations which I would have never otherwise have come across. Such was the case when I got stuck on the following problem: