math pow java time complexity