-
-
Save dlgusdn616/a7ff16785b64842fe046ccbd93e0a3b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 후위 순회 알고리즘 | |
void postorder(TreeNode *root) { | |
if (root) { | |
postorder(root->left); // 왼쪽 서브 트리를 가장 먼저 순회 | |
postorder(root->right); // 다음으로 오른쪽 서브 트리를 순회 | |
printf("%d", root->data); // 마지막으로 루트의 노드를 방문 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment