void list_from_chunks(Elem **ptr, Elem **chunks, int avoid, int group_len){
int next = (avoid+1)%group_len;
Elem *other = chunks[avoid];
Elem *tmp = other;
other->prev = NULL;
printf("here!!!!");
while(tmp->next != NULL && tmp->next != chunks[next]){
tmp = tmp->next;
}
tmp->next = NULL;
tmp = *ptr = chunks[next];
tmp->prev = NULL;
do{
next = (next+1)%group_len;
while(tmp->next != NULL && tmp->next != chunks[next]){
tmp = tmp->next;
}
if (tmp->next == NULL && next != avoid){
tmp->next = chunks[next];
tmp->next->prev = tmp;
}
else if (tmp->next == NULL && next == avoid){
printf("break");
break;
}
else if (tmp->next == chunks[next]){
printf("260!!!");
continue;
}
}while(1);//while(tmp->next != NULL && next != avoid);
}
group test
最新推荐文章于 2021-05-31 10:09:40 发布