Update dfs solution complexity discussion

This commit is contained in:
Donne Martin
2016-03-02 07:50:28 -05:00
parent de0e70de4f
commit 358791fbbc

View File

@@ -75,7 +75,7 @@
"\n", "\n",
"Complexity:\n", "Complexity:\n",
"* Time: O(n)\n", "* Time: O(n)\n",
"* Space: O(h), where h is the height of the tree\n", "* Space: O(m), where m is the recursion depth, or O(1) if using an iterative approach\n",
"\n", "\n",
"Note:\n", "Note:\n",
"* This is a form of a depth-first traversal\n", "* This is a form of a depth-first traversal\n",
@@ -88,7 +88,7 @@
"\n", "\n",
"Complexity:\n", "Complexity:\n",
"* Time: O(n)\n", "* Time: O(n)\n",
"* Space: O(h), where h is the height of the tree\n", "* Space: O(m), where m is the recursion depth, or O(1) if using an iterative approach\n",
"\n", "\n",
"Note:\n", "Note:\n",
"* This is a form of a depth-first traversal\n", "* This is a form of a depth-first traversal\n",
@@ -101,7 +101,7 @@
"\n", "\n",
"Complexity:\n", "Complexity:\n",
"* Time: O(n)\n", "* Time: O(n)\n",
"* Space: O(h), where h is the height of the tree\n", "* Space: O(m), where m is the recursion depth, or O(1) if using an iterative approach\n",
"\n", "\n",
"Note:\n", "Note:\n",
"* This is a form of a depth-first traversal" "* This is a form of a depth-first traversal"
@@ -265,21 +265,21 @@
], ],
"metadata": { "metadata": {
"kernelspec": { "kernelspec": {
"display_name": "Python 2", "display_name": "Python 3",
"language": "python", "language": "python",
"name": "python2" "name": "python3"
}, },
"language_info": { "language_info": {
"codemirror_mode": { "codemirror_mode": {
"name": "ipython", "name": "ipython",
"version": 2 "version": 3
}, },
"file_extension": ".py", "file_extension": ".py",
"mimetype": "text/x-python", "mimetype": "text/x-python",
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython2", "pygments_lexer": "ipython3",
"version": "2.7.10" "version": "3.4.3"
} }
}, },
"nbformat": 4, "nbformat": 4,