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

Fix wrong behaviour of queue on duplication #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

WKBae
Copy link

@WKBae WKBae commented Jan 9, 2018

The queue behavioured incorrectly on duplicate operation(as stated here), which can be reproduced with this code: 상받빠빠망망망하; the expected output is 333, but 330 is printed.

This commit fixes the issue of the code moving values when there is no space to insert at front, as following:

  1. The values start from queue_front + 1, not queue_front
  2. current_stack_top should be increased as the contents are pushed back.

@disjukr
Copy link
Member

disjukr commented Jan 9, 2018

Could you please add that behavior to standard test case?

@WKBae WKBae changed the title Fix wrong behaviour of stack on duplication Fix wrong behaviour of queue on duplication Jan 9, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants