自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 资源 (1)
  • 收藏
  • 关注

原创 leetcode 319 Bulb Switcher

1 暴力解法(超时): package leetcode;public class Solution319 { public int bulbSwitch(int n) { if(n == 0){ return 0; } boolean[] bulbs = new boolean[n]; int co

2016-05-31 23:03:01 306

转载 协同过滤算法

协同过滤算法详解: csdn blog:http://blog.csdn.net/acdreamers/article/details/44672305

2016-05-31 09:51:47 281

原创 KMP算法详解

KMP算法遇见很多次了,一没有弄明白。KMP算法是字符串匹配的经典算法,一次去百度面试的时候看隔壁的哥们对这个算法熟的飞起,遂下定决心搞明白这个算法。说起字符串匹配,最直接的想法就是用两次循环。时间复杂度大概是O(m*n),有没有更高效的算法和。看下面的例子:一般的匹配过程:code: * 暴力破解法 * @param ts 主串 * @param ps 模式串

2016-05-26 16:11:20 363

转载 leetcode 350. Intersection of Two Arrays II

350. Intersection of Two Arrays II My SubmissionsQuestionEditorial SolutionTotal Accepted: 4482 Total Submissions: 10704 Difficulty: EasyGiven two arrays, write a function to

2016-05-26 02:38:22 927

原创 leetcode Solution129

129. Sum Root to Leaf Numbers My SubmissionsQuestionEditorial SolutionTotal Accepted: 77138 Total Submissions: 234445 Difficulty: MediumGiven a binary tree containing digits

2016-05-25 11:25:21 770

原创 199. Binary Tree Right Side View

code:层次遍历打印每层最后一个/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ pu

2016-05-25 09:56:53 239

原创 leetcode 349

public class Solution { public int[] intersection(int[] nums1, int[] nums2) { HashSet set = new HashSet(); for(int i = 0;i < nums2.length; ++i) { for(int j = 0;j < num

2016-05-24 10:06:45 471

原创 leetcode 59 Spiral Matrix II 螺旋矩阵的打印

历时2个小时弄懂了螺旋矩阵的代码;小结如下:问题:Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example,Given n = 3,You should return the following matrix

2016-05-23 22:23:23 466

原创 leetcode 125. Valid Palindrome

leetcode 125. Valid Palindrome

2016-05-23 18:29:15 434

原创 百度之星2016资格赛 D

百度之星2016资格赛 D

2016-05-15 22:46:27 437

主题模型java代码

主题模型java代码,亲测可用效果很好。

2015-12-04

空空如也

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

TA关注的人

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