Why is this algorithm correct?

Previous slide Next slide Back to first slide View graphic version