自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

专注于机器学习,深度学习,人脸识别领域。

北大硕士,18年毕业,找工作中。。。

  • 博客(8)
  • 资源 (1)
  • 收藏
  • 关注

原创 floyd算法

今天看了弗洛伊德算法。 他的本质是动态规划。 就是图中两点之间如何求最短距离呢 假设有n个点 假如我们中间只能经过前一个点,那么就是这么写for(i=1;i<=n;i++){ for(j=1;j<=n;j++) { if ( e[i][j] > e[i][1]+e[1][j] ) e[i][j] = e[i][1]+e[1

2016-05-06 13:40:31 558

原创 121. Best Time to Buy and Sell Stock

问题: Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),

2016-05-06 09:50:02 275

原创 202. Happy Number

问题: Write an algorithm to determine if a number is “happy”.A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares

2016-05-04 23:14:43 286

原创 231. Power of Two

问题: Given an integer, write a function to determine if it is a power of two.我的解答:class Solution {public: bool isPowerOfTwo(int n) { if (n<=0) return false;int num = pow(2,(int)(log2(INT_MAX)))

2016-05-03 12:42:38 297

原创 263. Ugly Number

问题: Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is not ugly since

2016-05-02 19:50:50 244

原创 326. Power of Three

问题: Given an integer, write a function to determine if it is a power of three.Follow up: Could you do it without using any loop / recursion?我的解答:class Solution {public: bool isPowerOfThree(int n

2016-05-02 16:43:55 256

原创 70. Climbing Stairs

You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?

2016-05-02 15:31:48 276

原创 191.Number of 1 Bits

问题: Write a function that takes an unsigned integer and returns the number of ’1’ bits it has (also known as the Hamming weight).For example, the 32-bit integer ’11’ has binary representation 00000000

2016-05-02 11:13:26 257

空空如也

空空如也

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

TA关注的人

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