Solving parabolic and hyperbolic equations by the generalized finite difference method