# post order for binary search tree

I got this as the post order sequence but the answer says it is wrong. I do get a bit confused with the post order logic as well.

8 11 10 9 13 16 18 15

• 13 should be the last node visited. The order is (left subtree), (right subtree), (root). You are not exploring 13's right subtree first. – ryan Sep 29 '19 at 20:25
• I realised there are two 13's in the tree and I miseed one out in my sequence, so it would be 8 11 10 9 13 16 18 15 13? – Holz Sep 29 '19 at 21:03
• Two nodes with the same key? If yes, then this is not classic BST – HEKTO Sep 29 '19 at 21:34
• @Holz, yes. The sequence in your comment looks correct. – Steven Sep 29 '19 at 23:05

There are two 13 in the Binary Search Tree.
Instead, it can be replaced with 14 or any value in (13,15).
Resultant Traversal will be 8 11 10 9 x 16 18 15 13
where x is the value you choose to replace the left child of 15
The correct ordering is $$8, 11, 10, 9, 13,16,18,15,13$$