The prisoner's dilemma is widely used in the research of evolution of cooperation. This work is based on the assumption that players use non-discriminative strategies within their neighborhoods. The paper is also assumed that players have different memory sizes to store the previous interaction histories. Two different learning rules, copy-best-p layer and copy-best-strategy, are considered in this paper. In each round, a player can use either rule to select the appropriate strategy from his neighbors as his own strategy for the next round. The player uses preferential selection rule to select a neighbor to learn from. By the use of MC (Monte Carlo) simulation, research results are obtained as follows: 1) the preferential selection rule considerably improves the cooperation level in heterogeneous networks while it inhibits the emergence of cooperation in homogeneous regular network; 2) different learning rules and memory sizes significantly affect the evolution of cooperation in all types of network, especially in homogeneous network.