Optimization of Various kinds of Algorithms