Update tract.c

We just use selection sort by select the maximum of current array,
so we need to check whether pointer s and p is the same,
if different,then we need to  swap s->next and p->next.