From 6ad8c29af920748fe0ffa7ac757e319ede7cbccd Mon Sep 17 00:00:00 2001 From: Michael Chen Date: Sat, 19 Oct 2019 13:20:11 -0400 Subject: [PATCH] Fix pseudocode and test cases text --- stacks_queues/sort_stack/sort_stack_challenge.ipynb | 2 +- stacks_queues/sort_stack/sort_stack_solution.ipynb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/stacks_queues/sort_stack/sort_stack_challenge.ipynb b/stacks_queues/sort_stack/sort_stack_challenge.ipynb index ef3ba7e..3906acd 100644 --- a/stacks_queues/sort_stack/sort_stack_challenge.ipynb +++ b/stacks_queues/sort_stack/sort_stack_challenge.ipynb @@ -50,7 +50,7 @@ "source": [ "## Test Cases\n", "\n", - "* Empty stack -> None\n", + "* Empty stack -> empty stack\n", "* One element stack\n", "* Two or more element stack (general case)\n", "* Already sorted stack" diff --git a/stacks_queues/sort_stack/sort_stack_solution.ipynb b/stacks_queues/sort_stack/sort_stack_solution.ipynb index a4e3fe4..e61c2ee 100644 --- a/stacks_queues/sort_stack/sort_stack_solution.ipynb +++ b/stacks_queues/sort_stack/sort_stack_solution.ipynb @@ -49,7 +49,7 @@ "source": [ "## Test Cases\n", "\n", - "* Empty stack -> None\n", + "* Empty stack -> empty stack\n", "* One element stack\n", "* Two or more element stack (general case)\n", "* Already sorted stack" @@ -61,10 +61,10 @@ "source": [ "## Algorithm\n", "\n", - "* Our buffer will hold elements in reverse sorted order, smallest at the top\n", - "* Store the current top element in a temp variable\n", + "* Our buffer will hold elements in sorted order, largest at the top\n", "* While stack is not empty\n", - " * While buffer is not empty or buffer top is > than temp\n", + " * Pop the current top element of stack into a temp variable\n", + " * While buffer is not empty and buffer top is > than temp\n", " * Move buffer top to stack\n", " * Move temp to top of buffer\n", "* Return buffer\n",