algorithm about array