BST1 [자료구조] 이진 탐색 트리(BST, Binary Search Tree) 이진 탐색 트리 (binary search tree) ※ 이진 탐색 트리 삽입 구현 :: insert class Node: """이진 탐색 트리 노드 클래스""" def __init__(self, data): self.data = data self.parent = None self.right_child = None self.left_child = None def print_inorder(node): """주어진 노드를 in-order로 출력해주는 함수""" if node is not None: print_inorder(node.left_child) print(node.data) print_inorder(node.right_child) class BinarySearchTree: """이진 탐색 트리 클래스.. Algorithm 2023. 12. 29. 이전 1 다음 728x90