自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(67)
  • 资源 (2)
  • 收藏
  • 关注

原创 [LeetCode] 501. Find Mode in Binary Search Tree 解题报告

Given a binary search tree (BST) with duplicates, find all the mode(s) (the most frequently occurred element) in the given BST.Assume a BST is defined as follows:The left subtree of a node c

2017-04-28 05:41:56 3310 2

原创 [LeetCode] 467. Unique Substrings in Wraparound String 解题报告

Consider the string s to be the infinite wraparound string of "abcdefghijklmnopqrstuvwxyz", so s will look like this: "...zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd....".Now we ha

2017-04-03 05:17:24 748

原创 [LeetCode] 452. Minimum Number of Arrows to Burst Balloons 解题报告

There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the horizontal diameter. Since it's horizontal, y-coordin

2017-03-11 10:58:38 773

原创 [LeetCode] 451. Sort Characters By Frequency 解题报告

Given a string, sort it in decreasing order based on the frequency of characters.Example 1:Input:"tree"Output:"eert"Explanation:'e' appears twice while 'r' and 't' both appear once.So 'e

2017-03-07 07:02:14 461

原创 [LeetCode] 269. Alien Dictionary 解题报告

There is a new alien language which uses the latin alphabet. However, the order among letters are unknown to you. You receive a list ofnon-empty words from the dictionary, where words are sorted lex

2017-03-05 02:30:56 2552

原创 [LeetCode] 447. Number of Boomerangs 解题报告

Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between iand j equals the distance between i and k (the order of t

2017-03-01 05:04:21 545

原创 [LeetCode] 442. Find All Duplicates in an Array 解题报告

Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements that appear twice in this array.Could you do it without ex

2017-02-26 03:10:18 386

原创 [LeetCoee] 436. Find Right Interval 解题报告

Given a set of intervals, for each of the interval i, check if there exists an interval j whose start point is bigger than or equal to the end point of the interval i, which can be called that j is on

2017-02-25 04:20:58 500

原创 [LeetCode] 435. Non-overlapping Intervals 解题报告

Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.Note:You may assume the interval's end point is alw

2017-02-24 07:17:13 779

原创 [LeetCode] 463. Island Perimeter 解题报告

You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely

2017-02-21 02:45:27 448

原创 [LeetCode] 274. H-Index 解题报告

Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index.According to the definition of h-index on Wikipedia: "A

2017-02-20 00:47:26 1014

原创 [LeetCode] 56. Merge Intervals 解题报告

Given a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18].这一题其实没什么难度,算不上是个medium的题,但是有点奇怪的是,这题非常容易TLE。思路

2017-02-19 08:22:19 455

原创 [LeetCode] 279. Perfect Squares 解题报告

Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.For example, given n = 12, return 3 because 12 = 4 + 4 + 4; given n =

2017-02-19 03:04:32 852

原创 [LeetCode] 394. Decode String 解题报告

Given an encoded string, return it's decoded string.The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note thatk is

2017-02-18 06:56:04 563

原创 [LeetCode] 482. License Key Formatting 解题报告

Now you are given a string S, which represents a software license key which we would like to format. The string S is composed of alphanumerical characters and dashes. The dashes split the alphanumeric

2017-02-17 12:31:43 2207

原创 [LeetCode] 424. Longest Repeating Character Replacement 解题报告

Given a string that consists of only uppercase English letters, you can replace any letter in the string with another letter at most k times. Find the length of a longest substring containing all re

2017-02-17 10:15:19 1694

原创 [LeetCode] 423. Reconstruct Original Digits from English 解题报告

Given a non-empty string containing an out-of-order English representation of digits 0-9, output the digits in ascending order.Note:Input contains only lowercase English letters.Input is g

2017-02-17 05:09:24 351

原创 [LeetCode] 419. Battleships in a Board 解题报告

Given an 2D board, count how many battleships are in it. The battleships are represented with 'X's, empty slots are represented with'.'s. You may assume the following rules:You receive a valid b

2017-02-16 11:49:07 526

原创 Effective Java 读书笔记——43:返回零长度的数组或者集合,而不是null

我们先看一个比较常见的例子: private final List cheesesInStock=new ArrayList<>(); public Cheese[] getCheeses() { if(cheesesInStock.size()==0) { return null; } .... }把没有cheese可买当做一种特例,这是不合适的。如果这么做的

2017-02-16 08:40:31 569

原创 [LeetCode] 417. Pacific Atlantic Water Flow 解题报告

Given an m x n matrix of non-negative integers representing the height of each unit cell in a continent, the "Pacific ocean" touches the left and top edges of the matrix and the "Atlantic ocean" tou

2017-02-15 02:11:29 1180

原创 [LeetCode] 416. Partition Equal Subset Sum 解题报告

Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal.Note:Each of the array

2017-02-14 09:19:25 1988

转载 自然语言处理 HMM 维特比算法(Viterbi Algorithm) 实例转载

给大家推荐一个讲解HMM比较详细入门的内容:wiki上一个比较好的HMM例子这是另外一个例子,结合分词举例的HMM:自然语言处理1-马尔科夫链和隐马尔科夫模型(HMM)这是一个HMM相关文章索引。

2017-02-14 01:07:42 2049

原创 [LeetCode] 415. Add Strings 解题报告

Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2.Note:The length of both num1 and num2 is Both num1 and num2 contains only digits 0-9.

2017-02-13 08:08:42 318

原创 [LeetCode]414. Third Maximum Number 解题报告

Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexity must be in O(n).Example 1:Input: [3, 2,

2017-02-13 06:37:03 464

转载 标注问题与隐马尔科夫模型(Tagging Problems, and Hidden Markov Models)

本人正在学习NLP相关内容,学习到了Tagging Problem和Hidden Markov Models。推荐两篇基础入门文章:http://blog.csdn.net/lanxu_yy/article/details/29918015该文主要讲的是标注问题的原理基础,和相关的隐马尔科夫模型。http://blog.csdn.net/lanxu_yy/article/det

2017-02-12 03:57:24 496

原创 [LeetCode]413. Arithmetic Slices 解题报告

A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same.For example, these are arithmetic sequenc

2017-02-12 00:27:22 467

原创 [LeetCode] 412. Fizz Buzz 解题报告

Write a program that outputs the string representation of numbers from 1 to n.But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”.

2017-02-11 12:50:55 470

原创 [LeetCode]409. Longest Palindrome 解题报告

Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters.This is case sensitive, for example "Aa" is not con

2017-02-11 07:56:40 361

原创 [LeetCode]406. Queue Reconstruction by Height 解题报告

Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people in front of t

2017-02-11 00:22:03 391

原创 Effective Java 读书笔记——42:慎用可变参数

从Java 1.5开始就增加了可变参数(varargs)方法,又称作variable arity method。可变参数方法接受0个或多个指定类型的参数。它的机制是先创建一个数组,数组的大小为调用位置所传递的参数数量,然后将值传到数组中,最后将数组传递到方法。例如下面有个例子,返回多个参数的和: // Simple use of varargs - Page 197 stat

2017-02-08 06:21:42 824

翻译 Visualizing Representations: Deep Learning and Human Beings 简单翻译(数据可视化:深度学习和人类)(未完)

最近在学习NLP相关内容, 学到Visualizing Representations部分的时候,老师推荐读这篇文章。本文介绍了比较新的,而且实用的高维数据可视化方法,并且包含一些例子,里面没有太多的公式和算法,浅显易懂,适合入门的朋友阅读。本文于2015年1月26日发表于colah的github博客,原文链接:http://colah.github.io/posts/2015-01-Visu

2017-02-06 02:03:15 1971

转载 浅谈流形学习 Manifold Learning 和 SNE t-SNE

本人也刚刚学习流形学习不就,感觉很多东西都不太厉害。涉及很多微分流行和黎曼几何等数学知识。关于流行学习的科普文章首推pluskid写的《浅谈流行学习》,里面有很多通俗易懂的例子和解释。强烈推荐,看了以后会有一个直观的认识。

2017-02-05 01:15:54 3144

原创 Effective Java 读书笔记——41:慎用重载

先看一个使用重载错误的例子:public class CollectionClassifier { public static String classify(Set s) { return "Set"; } public static String classify(List lst) { return "List"; }

2017-02-02 11:27:02 1018

原创 Effective Java 读书笔记——1:考虑用静态工厂方法代替构造器

类可以提供一个公有的静态工厂方法(static factory method),是一个用来返回类的实例静态方法。比如,下面可以通过boolean来返回Boolean对象引用的方法: public static Boolean valueOf(boolean b) { return b ? Boolean.TRUE : Boolean.FALSE; }上面是一个非常简单的静态工厂方法,

2017-02-02 00:02:14 299

原创 Effective Java 读书笔记——38:检查参数的有效性

一般在方法执行之前先检查参数的有效性,如果参数值无效,那么很快它就会失败,并且清楚的抛出合适的异常。如果这个方法没有检查参数的异常,那么可能在方法处理中出现令人费解的异常。更糟糕的有可能是,方法可以正常返回,但是却使得某个对象处于被破坏的状态.抛出异常对于公有方法,可以在Javadoc中的@throw标签来说明违反异常时所抛出的异常类型。一旦在文档中说明了异常,那么强加这些类型的异常检

2017-01-31 05:41:29 803

原创 Effective Java 读书笔记——39:必要时进行保护性拷贝

容易被破坏的内部约束条件虽然如果没有主动提供公共方法和变量,外部是无法修改类内部的数据的。但是,对象可能会在无意识的情况下提供帮助。例如,下面就是一个通过引用来修改类内部的数据,而破坏对象内部的约束条件的例子:public final class Period { private final Date start; private final Date end; public Pe

2017-01-30 04:18:13 524

原创 Effective Java 读书笔记——15:使可变性最小化

不可变类不可变类是它的实例不能被修改的类。每个实例中所有的信息,必须在创建的时候提供,并在其整个对象周期内固定不变,例如:String,基本的包装类,BigInteger和BigDecimal。不可变的类更加的易于设计、实现和使用。它们不容易出错,而且更加安全。为了使类成为不可变的,一般遵循以下几个原则:不要提供任何会修改对象状态的方法(改变对象属性的方法,也称为mut

2017-01-30 00:38:16 481

原创 Effective Java 读书笔记——66:同步访问共享的可变数据

关键字synchronized可以保证同一时刻,只有一个线程可以执行某个方法。同步的概念1、当一个对象被一个线程修改的时候,可以阻止另一个线程观察到对象内部不一致的状态;2、同步不仅可以组织一个线程看到对象处于不一致的状态,还可以保证进入同步方法或者同步代码块的每个线程,都看到由同一个锁保护的之前所有的修改效果。另外,java语言规范保证读写一个变量是原子的,除非这个变量是doub

2017-01-27 14:03:11 840 3

原创 Effective Java 读书笔记——71:慎用延迟初始化

部分内容参考:http://blog.csdn.net/fgakjfd/article/details/5282646延迟初始化延迟初始化(Lazy Initialization)是延迟到需要域的值时才将它初始化的行为。不过对于延迟初始化,建议“除非绝对必要,否则就不要这么做”。静态内部类如果你不需要内部类对象与其外围类对象之间有联系,那你可以将内部

2017-01-27 04:30:52 1716

原创 Hbase-1.0+ Java API:BufferedMutatorExample,Hbase新API的使用

本人使用的是Hbase-1.2.0版本,在新的hbase api中以前的htable,htablepool都deprecated了,取而代之的是一些新的类来实现相关功能。首先是官方例子:/** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agr

2016-07-22 16:28:29 2682 2

hadoop-common-2.6.0-bin-master.zip

hadoop-common-2.6.0-bin-master.zip

2016-07-14

hadoop2.6.dll for Windows

2016-07-14

空空如也

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

TA关注的人

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