单链表---查询
/**
* 查询所有数据
* @param head
*/
void ShowList(List head) {
ListNode *p = head;
while (p != NULL) {
printf("%d--", p->data);
p = p->next;
}
printf("Nu1. \n");
}
/**
* 查询---根据数值查询
* @param a
* @return
*/
struct ListNode* findNode(List *head, int a) {
ListNode *temp = *head;
while (temp != NULL) {
if (a == temp->data) {
return temp;
}
temp = temp->next;
}
return NULL;
}