some algorithms and factorial using rec, it, and stack