Morgan Stanley Interview Question

use both recursion and iterative ways to implement power function