Skip to content

Instantly share code, notes, and snippets.

@dlgusdn616
Created November 16, 2018 14:17
Show Gist options
  • Save dlgusdn616/a7ff16785b64842fe046ccbd93e0a3b9 to your computer and use it in GitHub Desktop.
Save dlgusdn616/a7ff16785b64842fe046ccbd93e0a3b9 to your computer and use it in GitHub Desktop.
// 후위 순회 알고리즘
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