The initial call starts from A.
The value of alpha here is -INFINITY and the value of beta is +INFINITY.
These values are passed down to subsequent nodes in the tree.
At A the maximizer must choose max of B and C, so A calls B first.
At B it the minimizer must choose min of D and E and hence calls D first.
At D, the maximizer looks at its left child which is a leaf node.
To decide whether its worth looking at its right node or not, it checks the condition beta⇐alpha.
D now looks at its right child which returns a value of 5.
At D, alpha = max(3, 5) which is 5.
Now the value of node D is 5.
D returns a value of 5 to B.
At B, beta = min(+INF, 5) which is 5.
The minimizer is now guaranteed a value of 5 or less.
B now calls E to see if he can get a lower value than 5.
At E the values of alpha and beta is not -INF and +INF but instead -INF and 5 respectively, because the value of beta was changed at B and that is what B passed down to E.
Now E looks at its left child which is 6.
At E, alpha = max(-INF, 6) which is 6.
Note how it did not matter what the value of E's right child is.
It could have been +INF or -INF, it still would not matter.
We never even had to look at it because the minimizer was guaranteed a value of 5 or less.
So as soon as the maximizer saw the 6 he knew the minimizer would never come this way because the minimizer can get a 5 on the left side of B.
This way we do not have to look at that 9 and hence saved computation time.
E returns a value of 6 to B.
At B, beta = min(5, 6) which is 5.
The value of node B is also 5.
So far this is how our game tree looks.
This is how our final game tree looks like.