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 dadf405 commit 8b0a302Copy full SHA for 8b0a302
โinvert-binary-tree/mangodm-web.py
@@ -13,7 +13,8 @@ class Solution:
13
- Idea: ์ฌ๊ท๋ฅผ ์ด์ฉํ์ฌ ๊ฐ ๋ ธ๋์ ์ผ์ชฝ ์์๊ณผ ์ค๋ฅธ์ชฝ ์์์ ๋ฐ๊พผ๋ค.
14
- Time Complexity: O(n). n์ ์ ์ฒด ๋ ธ๋์ ์๋ค.
15
๋ชจ๋ ๋ ธ๋์ ๋ํด์ ๋ฐ๋ณต์ ์ผ๋ก ์ํํด์ผ ํ๊ธฐ ๋๋ฌธ์ O(n) ์๊ฐ์ด ๊ฑธ๋ฆฐ๋ค.
16
- - Space Complexity: O(h). h๋ ํธ๋ฆฌ์ ๋์ด๋ก, ์ฌ๊ท ํธ์ถ์ผ๋ก ์ธํ ์คํ ๊ณต๊ฐ์ด ํ์ํ๋ค.
+ - Space Complexity: O(n). n์ ์ ์ฒด ๋ ธ๋์ ์๋ค.
17
+ ์ต์ ์ ๊ฒฝ์ฐ, ๋ถ๊ท ํ ํธ๋ฆฌ์์๋ ์ฌ๊ท ํธ์ถ๋ก ์ธํด ์ต๋ O(n) ์คํ ๊ณต๊ฐ์ด ํ์ํ๋ค.
18
"""
19
20
def invertTree(self, root: Optional[TreeNode]) -> Optional[TreeNode]:
0 commit comments