mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-05 17:08:02 +00:00
Update dfs solution complexity discussion
This commit is contained in:
@@ -75,7 +75,7 @@
|
||||
"\n",
|
||||
"Complexity:\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",
|
||||
"Note:\n",
|
||||
"* This is a form of a depth-first traversal\n",
|
||||
@@ -88,7 +88,7 @@
|
||||
"\n",
|
||||
"Complexity:\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",
|
||||
"Note:\n",
|
||||
"* This is a form of a depth-first traversal\n",
|
||||
@@ -101,7 +101,7 @@
|
||||
"\n",
|
||||
"Complexity:\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",
|
||||
"Note:\n",
|
||||
"* This is a form of a depth-first traversal"
|
||||
@@ -265,21 +265,21 @@
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 2",
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python2"
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 2
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython2",
|
||||
"version": "2.7.10"
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.4.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
||||
Reference in New Issue
Block a user