sorting  array the help of pointer