We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c3026c commit b7c826bCopy full SHA for b7c826b
subtree-of-another-tree/bhyun-kim.py
@@ -28,9 +28,10 @@
28
The is_identical function has a time complexity of O(m).
29
Therefore, the overall time complexity is O(n*m).
30
31
- Space complexity: O(n)
32
- Where n is the number of nodes in the tree.
33
- The space complexity is O(n) because of the recursive calls to the depth_first_search function.
+ Space complexity: O(m+n)
+ Where n is the number of nodes in the tree and m is the number of nodes in the subtree.
+ The space complexity is O(m+n) because of the recursive calls to the depth_first_search function
34
+ and is_identical.
35
"""
36
37
0 commit comments