摘要: Implement pow(x, n). 思路:n为0时返回1。 之后我们只考虑n为正的情况(n为负时结果为正时的倒数)。之后我们通过二分法来求值。 假如n为偶数,则pow(x, n) = pow(x, n / 2) * pow(x, n / 2)。 假如n为奇数,则pow(x, n) = pow( 阅读全文
posted @ 2016-08-26 06:59 fenshen371 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Suppose we abstract our file system by a string in the following manner: The string "dir\n\tsubdir1\n\tsubdir2\n\t\tfile.ext" represents: The director 阅读全文
posted @ 2016-08-26 06:20 fenshen371 阅读(298) 评论(2) 推荐(0) 编辑