If your professor asked to figure it out on your own, your professor is probably going to ask you to write some pseudo code on an exam. The right way to tackle this algorithm is to watch a youtube...