The algorithm works as follows:

  • if then
    • return
  • else
    • return