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

数据结构前置知识——《【动画模拟】栈和队列详解》一文中有个计算错误 #27

Open
DEROOCE opened this issue May 28, 2021 · 2 comments

Comments

@DEROOCE
Copy link

DEROOCE commented May 28, 2021

然后我们再根据以下公式则能够判断队列满没满了。

(rear+1)%queuesize==front

queuesize,代表队列的长度,上图为5。我们来判断上面两张图是否满。(4+1)%5==0,(1+1)%5==3

两种情况都是满的,over。

在循环队列一节中,最后判断队列是否已满,(1+1)%5==3的计算结果应为2.

@chefyuan
Copy link
Owner

嗯嗯,这里修改了

@danielesk
Copy link

@chefyuan 回答一下#24

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

3 participants