Skip to content

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.

2 participants