What is the space complexity of the post-order traversal in the recursive fashion?

Q & ACategory: Data StructureWhat is the space complexity of the post-order traversal in the recursive fashion?
Admin Staff asked 4 years ago

What is the space complexity of the post-order traversal in the recursive fashion? (d is the tree depth and n is the number of nodes)
a) O(1)
b) O(nlogd)
c) O(logd)
d) O(d)

1 Answers
Admin Staff answered 4 years ago

d) O(d)