From 170f32b7e01bd51b6c11f526e4bbbb7d132e6df3 Mon Sep 17 00:00:00 2001 From: Donne Martin Date: Fri, 3 Jul 2015 20:10:14 -0400 Subject: [PATCH] Tweaked quick sort challenge. --- .../quick_sort/quick_sort_challenge.ipynb | 26 +++++++++++++++---- .../quick_sort/quick_sort_solution.ipynb | 18 ++++++++----- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/sorting_searching/quick_sort/quick_sort_challenge.ipynb b/sorting_searching/quick_sort/quick_sort_challenge.ipynb index 1c42b7d..550dd65 100644 --- a/sorting_searching/quick_sort/quick_sort_challenge.ipynb +++ b/sorting_searching/quick_sort/quick_sort_challenge.ipynb @@ -4,7 +4,14 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "This notebook was prepared by [Donne Martin](http://donnemartin.com). Source and license info is on [GitHub](https://bit.ly/code-notes)." + "This notebook was prepared by [Donne Martin](http://donnemartin.com). Source and license info is on [GitHub](https://github.com/donnemartin/coding-challenges)." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Challenge Notebook" ] }, { @@ -18,7 +25,7 @@ "* [Algorithm](#Algorithm)\n", "* [Code](#Code)\n", "* [Unit Test](#Unit-Test)\n", - "* [Pythonic-Code](#Pythonic-Code)" + "* [Solution Notebook](#Solution-Notebook)" ] }, { @@ -27,7 +34,7 @@ "source": [ "## Constraints\n", "\n", - "*Problem statements are often intentionally ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n", + "*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n", "\n", "* Is a naiive solution sufficient (ie not in-place)?\n", " * Yes" @@ -50,7 +57,7 @@ "source": [ "## Algorithm\n", "\n", - "Refer to the solution notebook. If you are stuck and need a hint, the solution notebook's algorithm discussion might be a good place to start." + "Refer to the [Solution Notebook](http://nbviewer.ipython.org/github/donnemartin/coding-challenges/blob/master/sorting_searching/quick_sort/quick_sort_solution.ipynb). If you are stuck and need a hint, the solution notebook's algorithm discussion might be a good place to start." ] }, { @@ -79,7 +86,7 @@ "source": [ "## Unit Test\n", "\n", - "*It is important to identify and run through general and edge cases from the [Test Cases](#Test-Cases) section by hand. You generally will not be asked to write a unit test like what is shown below.*\n", + "\n", "\n", "**The following unit test is expected to fail until you solve the challenge.**" ] @@ -128,6 +135,15 @@ "if __name__ == '__main__':\n", " main()" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Solution Notebook\n", + "\n", + "Review the [Solution Notebook](http://nbviewer.ipython.org/github/donnemartin/coding-challenges/blob/master/sorting_searching/quick_sort/quick_sort_solution.ipynb) for a discussion on algorithms and code solutions." + ] } ], "metadata": { diff --git a/sorting_searching/quick_sort/quick_sort_solution.ipynb b/sorting_searching/quick_sort/quick_sort_solution.ipynb index 307caea..8821111 100644 --- a/sorting_searching/quick_sort/quick_sort_solution.ipynb +++ b/sorting_searching/quick_sort/quick_sort_solution.ipynb @@ -4,7 +4,14 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "This notebook was prepared by [Donne Martin](http://donnemartin.com). Source and license info is on [GitHub](https://bit.ly/code-notes)." + "This notebook was prepared by [Donne Martin](http://donnemartin.com). Source and license info is on [GitHub](https://github.com/donnemartin/coding-challenges)." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Solution Notebook" ] }, { @@ -17,8 +24,8 @@ "* [Test Cases](#Test-Cases)\n", "* [Algorithm](#Algorithm)\n", "* [Code](#Code)\n", - "* [Unit Test](#Unit-Test)\n", - "* [Pythonic-Code](#Pythonic-Code)" + "* [Pythonic-Code](#Pythonic-Code)\n", + "* [Unit Test](#Unit-Test)" ] }, { @@ -27,7 +34,7 @@ "source": [ "## Constraints\n", "\n", - "*Problem statements are often intentionally ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n", + "*Problem statements are sometimes ambiguous. Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n", "\n", "* Is a naiive solution sufficient (ie not in-place)?\n", " * Yes" @@ -134,8 +141,7 @@ "metadata": {}, "source": [ "## Unit Test\n", - "\n", - "*It is important to identify and run through general and edge cases from the [Test Cases](#Test-Cases) section by hand. You generally will not be asked to write a unit test like what is shown below.*" + "\n" ] }, {