typedef struct dnode
{
int data;
struct dnode *prior;
struct dnode *next;
}DNode;
/*返回value值在链表中的位置,没有该值将返回0*/
int searchDNode(DNode *head, int value)
{
int i = 1;
DNode *p = head->next;
while(p)
{
if(p->data == value)
return i;
else
{
p = p->next;
i++;
}
}
return 0;
}
阅读(853) | 评论(0) | 转发(0) |