typedef struct dnode
{
int data;
struct dnode *prior;
struct dnode *next;
}DNode;
DNode *reverseDNode(DNode *head)
{
DNode *p = head->next;
DNode *q = p->next;
DNode *r = q->next;
if(head == NULL || head->next ==NULL)
return head;
p->next = NULL;
while(r != NULL)
{
q->next = p;
p->prior = q;
p = q;
q = r;
r = r->next;
}
q->next = p;
p->prior = q;
head->next = q;
q->prior = head;
return head;
}
阅读(938) | 评论(0) | 转发(0) |