Draw everything: my whiteboard habit for trees and graphs
I bought a cheap whiteboard and it was the best purchase of the semester. Before writing any tree or graph code, I draw the structure, then walk through the operation step by step with a marker.
Why it helps: bugs in pointer-heavy code are almost always "I updated the wrong reference" or "I forgot one." When you draw it, you can see the arrow you forgot to move.
Bonus: erasing and redrawing a rotation five times is weirdly calming.
Comments
Whiteboard gang. Also works great for graphs.