Proof of Correctness :/


#1

Can anybody give the proof of correctness of this method at least an intuitive one?