[프로그래머스] - 길 찾기 게임 (파이썬)
import sys sys.setrecursionlimit(10**3) class Node: def __init__(self, index, x, y): self.index = index self.x = x self.y = y self.left = None self.right = None class Tree: def __init__(self, index, x, y): self.head = Node(index, x, y) def insert(self, index, x, y): curr = self.head while True: if curr.x > x: if curr.left == None: curr.left = Node(index, x, y) break else: curr = curr.left else: ..
2022. 2. 15.