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

Queue的方法isEmpty实现有些问题? #7

Open
iamqk opened this issue Apr 19, 2022 · 0 comments
Open

Queue的方法isEmpty实现有些问题? #7

iamqk opened this issue Apr 19, 2022 · 0 comments

Comments

@iamqk
Copy link

iamqk commented Apr 19, 2022

应该使用如下的方法实现吧?

- (BOOL)isEmpty
{
//    if (self.queueArray.count == 0)
    if (self.countOfQueue == 0)
    {
        return YES;
    }
    return NO;
}


- (NSInteger)countOfQueue
{
//    return self.queueArray.count;
    return self.queueArray.count - self.headIndex;
}
@iamqk iamqk changed the title Queue的实现方法isEmpty有些问题? Queue的方法isEmpty实现有些问题? Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant