Help with this code and its algorithm¡¡¡¡¡¡

every "Void" that has the code

There are no "Void"s in your sketch. There are FUNCTIONS. That the return type is void matters not a whit.

The code seems relatively straight-forward. It is obvious that you didn't write the code. It seems equally obvious that you are trying to understand it so you can palm it off as your own.

So, you need to explain to us what YOU think it does, and we'll tell you whether you are right or wrong.