Pre-order to post-order traversal

后端 未结 11 1491
挽巷
挽巷 2020-12-23 21:56

If the pre-order traversal of a binary search tree is 6, 2, 1, 4, 3, 7, 10, 9, 11, how to get the post-order traversal?

11条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-23 22:29

    you are given the pre-order traversal results. then put the values to a suitable binary search tree and just follow the post-order traversal algorithm for the obtained BST.

提交回复
热议问题