트리1 [트리] 전위순회, 중위순회, 후위순회 트리를 공부하며 순회에 대해 재귀함수로 구현해보는 경험을 가졌다. 스택프레임에 대한 기초 개념에 대해 이해할 수 있게 되었다. class Node{ int data; Node lt,rt; public Node(int val){ this.data = val; lt = rt = null; } } class Main { public static void main(String[] args) { Node root = new Node(1); root.lt = new Node(2); root.rt = new Node(3); root.lt.lt = new Node(4); root.lt.rt = new Node(5); root.rt.lt = new Node(6); root.rt.rt = new Node(7); solut.. 2022. 4. 11. 이전 1 다음