recursive and iterative version on few operations on arrays !