自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(5)
  • 收藏
  • 关注

原创 Leetcode--50. Pow(x, n)

题目Implement pow(x, n).思路递归的方式,递归关系可以表示为 pow(x,n) = pow(x,n/2)*pow(x,n-n/2),从而将时间复杂的降到O(logn)代码class Solution {public: double myPow(double x, int n) { if(n==0) return 1.0;

2017-08-29 15:27:14 355

原创 Leetcode--338. Counting Bits

题目Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and return them as an array.Example: For num = 5 you

2017-08-27 20:50:31 301

原创 Leetcode--655. Print Binary Tree

题目Print a binary tree in an m*n 2D string array following these rules:The row number m should be equal to the height of the given binary tree. The column number n should always be an odd number. The

2017-08-09 09:47:11 403

原创 Leetcode--Add to List 374. Guess Number Higher or Lower

题目We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wrong, I’ll tell you whether the number is higher o

2017-08-02 11:00:13 258

原创 Leetcode--Add to List 371. Sum of Two Integers

题目Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example: Given a = 1 and b = 2, return 3. 不使用+ - 实现加法思路位运算来实现代码递归版本class Solution {public: int ge

2017-08-02 10:34:12 251

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除