Skip to content

Conversation

leokim0922
Copy link
Contributor

No description provided.

return solve(root, subRoot)

## TC: O(mn), where m and n denote len(subroot) and len(root)
## SC: O(m+n)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


return solve(root, subRoot)

## TC: O(mn), where m and n denote len(subroot) and len(root)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leokim0922 님은 잘 하시니, 시간 복잡도를 $O(m + n)$으로 개선할 수 있는 방법도 고민해보시면 좋을 것 같습니다. 😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이게 시간 복잡도 O(m+n)도 가능한 줄 몰랐네요. 아직 갈 길이 멀군요.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hint: 어떻게 하면 subRoot를 대상으로 중복 순회하는 것을 방지할 수 있을까? 🧠

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

흠 이미 방문한 node를 visited 처리해서 안돌면 될거같은데 고민을 좀 해봐야할거같네요 😓

Copy link
Member

@DaleSeo DaleSeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

피드백 반영해주셔서 감사합니다. @leokim0922 님은 머지 권한이 있으시니 직접 하시길 바랍니다.

@leokim0922 leokim0922 merged commit 4b7905f into DaleStudy:main May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants