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 sort_stack pseudocode and test cases text #263

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix sort_stack pseudocode and test cases text #263

wants to merge 1 commit into from

Conversation

ML-Chen
Copy link

@ML-Chen ML-Chen commented Oct 19, 2019

Here are some suggestions I have for the wording of sort_stack_challenge.ipynb and sort_stack_solution.ipynb, to reflect the actual code and test cases more accurately:

  • Based on the code and the test cases, the output given an empty stack should be another empty stack, not None
  • Buffer stores elements in sorted order, with largest element at top, not reverse sorted order with smallest element at top. Otherwise, how could we return buffer as our answer when the output should have the largest element at the top?
  • While buffer is not empty and buffer top is > than temp (not or)
  • Clarify that the top element is not just copied to a temp variable, but rather popped off into the temp variable. This happens within the while loop, not before.

#264

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants