Figure 3: The algorithm flow chart.