#3 Parse & ReverseParse a Binary Tree
2020. 8. 15. 16:06ㆍPS/도전
All problems are from https://www.dailycodingproblem.com/
Solution Codes : https://github.com/Kusin/DailyCoding
#3
An opportunity to practice Python!
Solution
Generally, inorder Traversal can't recover the origianl Tree since there are more than one possible trees.
However, if we put the information about its children, we can restore the original Tree
Implementation
Tips :
- How to change many lines into one
Use Semicolons!
(before)
a=3
b=3
print(a+b)
(after)
a=3; b=3; print(a+b)
-difference between instance variable and class variable.
although I didn't use the concept on this problem, it was helpful for me to understand python
If you know korean, check this link. https://wikidocs.net/1744
728x90
'PS > 도전' 카테고리의 다른 글
Problem #5 Implementing Pair in Python (0) | 2020.08.15 |
---|---|
Problem #4 : First missing positive integer (0) | 2020.08.15 |
#1 2SUM #2 No Division Multiplying (0) | 2020.08.07 |
KOI 2019 2차 대회 2번 '괄호' 풀이 (0) | 2020.07.11 |
한국정보올림피아드(KOI) 공부 시작하기 (9) | 2020.05.01 |