
[백준 4256번] 트리 | python 풀이
·
Baekjoon/python
📝 백준 4256 🌲트리🌲🌲🌲 분할 정복, 재귀 https://www.acmicpc.net/problem/4256 🔷 Submission Code import sys def findIndex(preO, inO): ##* 재귀 종료 if len(preO) == 0: return elif len(preO) == 1: print(preO[0], end=' ') return elif len(preO) == 2: print(preO[1], preO[0], end=' ') return root = preO[0] midIndex = inO.index(root) # 4 # print('mid!!!!',midIndex) ##* 분할 # 중위 divide 부분 inOLeft = inO[:midIndex] # 0~3 inO..