Monte Carlo and exact enumeration method were applied to the random walk problems on Sierpinski gasket and pentagonal lattice. The mean square displacement $R^2(t)$ was calculated by the two methods and the probability of returning to the origin by exact enumeration method. The calculated values of the anomalous-diffusion exponent ($d_w=2.32\pm0.012$) and the spectral dimension ($d_s=1.65\pm0.0066$) in the gasket fractal are in good agreement with the theoretical values. The diffusion exponent of the pentagonal lattice is found to be identical to the space dimension.