LeetCode(C++)
文章平均质量分 53
一苇以航hkz
心之所向 素履以往。生如逆旅,一苇以航。
展开
-
LeetCode--Pow(x,n)
Problem50—Pow(x,n)DisciptionImplement pow(x, n).Trapn的输入为int型,当n为MIN_INT时,取反之后会溢出Solution Brute 暴力计算xnx^n Binary 二分法 Bit 位操作法 Code Code for Brute //迭代版本 class Solution { public: double myPow(dou原创 2017-07-19 23:13:45 · 243 阅读 · 0 评论 -
LeetCode--Search for a range
DisciptionGiven an array of integers sorted in ascending order, find the starting and ending position of a given target value.Your algorithm’s runtime complexity must be in the order of O(log n).If the原创 2017-07-24 14:31:39 · 203 阅读 · 0 评论