The treewidth of a linear code is the least constraint complexity of any of its cycle-free graphical realizations. This notion provides a useful parametrization of the maximumlikelihood decoding complexity for linear codes. In this paper, we compute exact expressions for the treewidth of maximum distance separable codes, and first-and second-order Reed-Muller codes. These results constitute the only known explicit expressions for the treewidth of algebraic codes.