2
GUI로보기 위해 노드로 구성된 BinaryTree를 JTree로 변환하려고합니다. 나는 이것이 필자가 필요로하는 의사 코드라고 생각한다 :BinaryTree to JTree?
if root == null
set data as root
if data < root
if leftNode == null
add data to left node
if data < leftNode
add data to left node
if data > leftNode
add data to right node
if data > root
if rightNode == null
add data to right node
if data < right node
add data to left node
if data > right node
add data to right node
이 의사 코드를 실제로 구현하는 방법에 대한 아이디어가 있으십니까? 모든 자식 노드에 영향을주기 위해 재귀가 필요하다는 것을 알고 있습니다.