mirror of
https://github.com/huihut/interview.git
synced 2024-03-22 13:10:48 +08:00
Update LinkList_with_head.cpp
https://github.com/huihut/interview/issues/34
This commit is contained in:
parent
04650523b3
commit
7f5fe39580
@ -78,7 +78,10 @@ Status EnQueue_LQ(LinkList &L, ElemType &e) {
|
|||||||
if (NULL == L) return OVERFLOW;
|
if (NULL == L) return OVERFLOW;
|
||||||
L -> next = q;
|
L -> next = q;
|
||||||
}
|
}
|
||||||
else if (NULL == L->next) L = q;
|
else if (NULL == L->next)
|
||||||
|
{
|
||||||
|
L -> next = q;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
p = L;
|
p = L;
|
||||||
@ -106,6 +109,7 @@ Status DeQueue_LQ(LinkList &L, ElemType &e) {
|
|||||||
//遍历调用
|
//遍历调用
|
||||||
Status visit(ElemType e) {
|
Status visit(ElemType e) {
|
||||||
printf("%d\t", e);
|
printf("%d\t", e);
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
//遍历单链表
|
//遍历单链表
|
||||||
|
Loading…
x
Reference in New Issue
Block a user