This paper present a novel numerical algorithm for the linear one-dimensional heat and wave equation. In this method, a nite dierenceapproach had been used to discrete the time derivative while cubic spline isapplied as an interpolation function in the space dimension. We discuss theaccuracy of the method by expanding the equation based on Taylor series andminimize the error. The proposed method has eighth-order accuracy in spaceand fourth-order accuracy in time variables. From the computational pointof view, the solution obtained by this method is in excellent agreement withthose obtained by previous works and also it is ecient to use. Numericalexamples are given to show the applicability and eciency of the method.