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
from

Conversation

Projects
None yet
2 participants
@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.

WKBae added some commits Jan 9, 2018

@disjukr

This comment has been minimized.

Show comment
Hide comment
@disjukr

disjukr Jan 9, 2018

Member

Could you please add that behavior to standard test case?

Member

disjukr commented Jan 9, 2018

Could you please add that behavior to standard test case?

@WKBae WKBae changed the title from Fix wrong behaviour of stack on duplication to 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