Zero-Divisor Graphs of Polynomials and Power Series Over Commutative Rings