Skip to content

Commit 56dd652

Browse files
committed
add time complexity and space complexity
1 parent 0164851 commit 56dd652

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

subtree-of-another-tree/hyer0705.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
* }
1313
*/
1414

15+
// Time Complexity: O(m * n), m: root의 노드 수, n: subRoot의 노드 수
16+
// Space Complexity: O(h), h: root의 높이
1517
function isSubtree(root: TreeNode | null, subRoot: TreeNode | null): boolean {
1618
if (!root) return false;
1719

0 commit comments

Comments
 (0)