Rearranged Algorithms according to type