void sort(struct node **headRef){ /*using selection sort*/ struct node* i = NULL; struct node* j = NULL; //int size = countNodes(*headRef); for(i = *headRef; i != NULL; i = i->next){ for(j = i->next; j != NULL; j = j->next){ printf("finding min, and j is %d , and i is %d \n", j->item, i->item); //printf("j->next value is %d \n", j->next->item); } } }