May 2017
Intermediate to advanced
340 pages
8h 16m
English
In post-order traversal, the root node is visited last. The first left node is visited and then the right node. The principles of post-order traversal are as follows:

The preceding tree will have the output A, C, E, D, B, H, I, G, and F since it is traversed in a post-order way.
Now, let's implement the traversal logic in our BST class:
public function traverse(Node $node, string $type="in-order") { switch($type) { case "in-order": ...Read now
Unlock full access