Update gen_algorithm.py

included example case