Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

未定义指针p,应该是LNode *q=L->link, *p = L->link; #31

Open
csmasterpath opened this issue Aug 24, 2022 · 1 comment
Open

未定义指针p,应该是LNode *q=L->link, *p = L->link; #31

csmasterpath opened this issue Aug 24, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@csmasterpath
Copy link

int SearchRearK(LNode *L, int k)
{
    int count=0;//用来计数
    LNode *q=L->link;
    while(p!=NULL)
    {
        if(count<k)
            count++;
    	else
            q=q->link;//当count等于开始,q和p同步向后移动
    	p=p->link; 
    }
    if(count<k)
        return 0;//如果链表节点个数小于k
    elseprintf("%d",q->data);
        return 1;
    }
}
@xiaolei565 xiaolei565 added the bug Something isn't working label Aug 31, 2022
@xiaolei565
Copy link
Owner

确实是的,感谢说明更正

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants