自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 LeetCode Plus One Java版解题报告

LeetCode Plus One Java版解题报告 题意:一个整数按位存储于一个int数组中,排列顺序为:最高位在array[0] ,最低位在[n-1],例如:98,存储为:array[0]=9; array[1]=8;解题思路,从数组的最后一位开始加1,需要考虑进位,如果到[0]位之后仍然有进位存在,需要新开一个长度为(n.length + 1)的数组,拷贝原来的数组。

2015-01-10 23:03:51 9270 1

原创 LeetCode Intersection of Two Linked Lists 解题报告

LeetCode Intersection of Two Linked Lists 解题报告,求两个链表的第一个公共节点。

2014-12-29 00:25:56 2449

原创 LeetCode Roman to Integer 罗马字符转数字 解题报告

LeetCode Roman to Integer 解题报告: 把一个字符串形式的罗马字符串转为数字。

2014-12-21 20:46:29 2632

原创 LeetCode ZigZag Conversion 解题报告

LeetCode ZigZag Conversion 解题报告对输入字符串,做蛇形变化,然后按行输出。

2014-12-14 21:20:03 1647

原创 LeetCode Count and Say 解题报告

LeetCode Count and Say 解题报告如何数(shu 三声) 数(shu 四声):1,11,21,1211,111221,312211,13112221,1113213211

2014-12-05 15:09:28 10554

原创 LeetCode Add Binary 结题报告

Leetcode 二进制加法,解题报告

2014-11-29 09:46:51 1823

原创 LeetCode Merge k Sorted Lists 解题报告

合并K个已排序的数组,并分析整个算法的复杂度。最朴素的方法TLE,借鉴归并排序的算法顺利AC,算法时间复杂度:NlogK

2014-10-11 15:23:24 9083 3

原创 LeetCode Maximum Product Subarray 解题报告

LeetCode 新题又更新了,最大子数组乘积题目分析:求一个数组,连续子数组的最大乘积。

2014-10-06 12:09:35 14793 1

原创 LeetCode Convert Sorted List to Binary Search Tree 解题报告

从给定的有序链表生成一颗平衡二叉树。解题思路:最容易想到的就是利用数组生成二叉树的方法,找到中间节点作为二叉树的root节点,然后分别对左右链表递归调用分别生成左子树和右子树。时间复杂度O(N*lgN)

2014-10-01 22:30:08 12626

原创 LeetCode Longest Valid Parentheses 解题报告

分析,求出一串由:‘(’和‘)’组成的字符串中最长有效括号的长度。例如:(()(),结果是4。((()))结果是6。())()()结果是4。

2014-09-22 00:24:27 10333

原创 LeetCode Construct Binary Tree from Preorder and Inorder Traversal

Construct Binary Tree from Preorder and Inorder Traversal 结题报告从前序遍历和中序遍历的结果重建一颗二叉树。解题思路,随便写一个二叉树,然后写出前序和中序遍历的结果会发现特点。二叉树的首节点必然是前序遍历的第一个节点,以这个节点在中序遍历的结果中作为划分,这个节点左侧的是左子树的节点,右侧是右子树节点。例如,一个二叉

2014-09-14 19:27:59 2009 1

原创 LeetCode Subsets 和 LeetCode Subsets II

LeetCode Subsets 和 LeetCode Subsets II 给出一个数组生成该数组所有元素的组合。基本思路先对数组排序,然后循环+dfs,生成指定元素数目为:1,2,...array.size()个元素的组合。

2014-04-09 22:02:48 11856

原创 LeetCode Combination Sum II

LeetCode Combination Sum II 题意分析:从给定数组中找到一组数字,要求这组数字之和等于target。另外,数字不允许重复。解题思路:显然先排序,然后dfs。

2014-04-08 19:05:09 5892

原创 LeetCode Palindrome Partitioning II

LeetCode Palindrome Partitioning II解题报告对输入的字符串进行划分,要求划分后的所有的子字符串都是回文串。求最小划分的个数。动态规划方法求解。

2014-03-25 15:48:56 10043 1

原创 LeetCode Palindrome Partitioning

LeetCode Palindrome Partitioning 解题报告将输入的字符串划分为一组回文字符串。动态规划加深度搜索。

2014-03-25 10:45:47 9368 3

原创 LeetCode Recover Binary Search Tree

LeetCode Recover Binary Search Tree 解题报告 二叉排序树中有两个节点被交换了,要求把树恢复成二叉排序树。最简单的办法,中序遍历二叉树生成序列,然后对序列中排序错误的进行调整。最后再进行一次赋值操作。

2014-03-21 09:37:48 14330 3

原创 LeetCode Insert Interval

合并所有覆盖的区间,一道对逻辑思维要求比较高的题。Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according t

2014-03-20 13:40:08 10831

原创 LeetCode Gray Code

LeetCode 生成n位格雷码

2014-03-19 16:03:39 18232 3

原创 LeetCode Permutations

全排列问题,今天看到微博上有人说清华的研究生复试上机试题有一道全排列问题,貌似学生们回答的不好。想起以前在leetcode上面也刷过全排列问题,就又重新AC了一次。Given a collection of numbers, return all possible permutations.For example,[1,2,3] have the following permuta

2014-03-18 23:42:25 11622 4

原创 Leetcode Restore IP Addresses

Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given "25525511135",return ["255.255.11.135", "255.255.111.35"]. (Order does

2014-03-16 20:25:55 5434 1

原创 求根节点到树中任一结点的路径

求根节点到树中任一结点的路径很有用,比如要求两个节点最近公共节点的时候。思路很简单,递归寻找,把中间经过的节点放入ArrayList中,但有个地方需要用到回溯,否则返回值会不好判断。写出来代码会比较臃长。最佳实现:public static boolean getPathFromRoot(TreeNode root, TreeNode node, ArrayList pathA

2014-03-14 10:14:41 8063 1

原创 LeetCode Reverse Words in a String

http://oj.leetcode.com/problems/reverse-words-in-a-string/Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".看上去有点象以前两次re

2014-03-12 09:51:49 5062

原创 Leetcode Flatten Binary Tree to Linked List

Given a binary tree, flatten it to a linked list in-place.For example,Given         1        / \       2   5      / \   \     3   4   6The flattened tree should look like:   1

2014-02-28 23:59:27 2196

原创 Leetcode Decode Ways 解题报告

A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determine the total numb

2014-02-25 23:06:03 18615

原创 Leetcode Distinct Subsequences 解题报告

Leetcode Distinct Subsequences 解题报告只可以用删除字符的方法从第一个字符串变换到第二个字符串,求出一共有多少种变换方法。http://oj.leetcode.com/problems/distinct-subsequences/

2014-02-23 21:51:17 11746 1

原创 Leetcode Search for a Range 解题报告

二分搜索的一个变种,找到target存在的区间。

2014-02-19 22:30:46 1235

原创 LeetCode Word Break II 解题报告

Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.Return all such possible sentences.For example, givens = "cats

2014-02-18 22:39:53 2268 2

原创 Leetcode Word Ladder II 解题报告

http://oj.leetcode.com/problems/word-ladder-ii/Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that:Only one letter can be c

2014-02-16 22:40:21 11615 3

原创 Leetcode Surrounded Regions 解题报告

http://oj.leetcode.com/problems/surrounded-regions/Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's in that surrou

2014-02-15 20:57:18 5475 1

原创 LeetCode Word Ladder解题报告

Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:Only one letter can be changed at a timeEach intermediate word m

2014-02-14 23:24:18 4988

原创 Linux 常用Shell面试题(一)

Linux下面开发,Shell命令也是面试时候经常问到的问题。本专题中涉及到的都是比较需要组合多个命令才能完成的命令。一,替换当前某个目录下所有文件中的:www.sina.com.cn为sina.com.cn这道题至少有4个知识点1,你需要知道替换使用sed2,你需要知道如何遍历当前目录下的所有文件3,你需要如何对每个找到的文件应用sed4,你需要知道sed默认替换的时

2014-02-13 13:04:39 3541 1

原创 Leetcode Insertion Sort List 解题报告

http://oj.leetcode.com/problems/insertion-sort-list/Sort a linked list using insertion sort.基本分析:用插入排序对一个链表进行排序。一开始写的时候想套用数组的插入排序,结果发现无法对末节点加上NULL。对链表进行插入排序的正确方法是:新建一个头节点,遍历原来的链表,在新链表中找到适合的位

2014-02-11 09:23:37 6526 2

原创 Leetcode Jump Game II 解题报告

Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Your goal is to

2014-02-09 15:37:38 2126

原创 Leetcode Jump Game 解题报告

Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine if yo

2014-02-08 18:08:28 3642

原创 LeetCode Word Break 解题报告

Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcode",dict = ["leet",

2014-02-08 17:39:22 3744 1

原创 LeetCode Sort List 解题报告

Sort a linked list in O(n log n) time using constant space complexity.http://oj.leetcode.com/problems/sort-list/解题报告:就是对一个链表进行归并排序。找到链表的middle节点,然后递归对前半部分和后半部分分别进行归并排序,最后再进行Merge。/** * De

2014-02-08 15:31:49 9717 6

原创 LeetCode Binary Tree Maximum Path Sum 解题报告

返回树中任意两点路径的最大值,只要两点间有路径可以到达就算。

2014-02-06 22:43:45 11993 2

原创 C++面试题(三)——STL相关各种问题

C++面试题——STL相关各种问题唐璐http://blog.csdn.net/worldwindjp/STL相关的各种问题1,用过那些容器。2,vector,list,deque的实现。3,hashmap和map有什么区别。4,map是怎么实现的?

2014-02-03 15:53:57 15945

原创 C++面试题(一)——基础概念篇

C++面试题——基础概念篇普通C++面试时候的一般都是这个套路:     1,C++和C相比最大的特点                   1)面向对象:封装,继承,多态。                   2)引入引用代替指针。                   3)const /inline/template解决宏常量。                   4)na

2014-02-03 13:06:10 8755 2

原创 Leetcode Pow(x, n) 解题报告

http://oj.leetcode.com/problems/powx-n/求出x的n次方。x是double类型,n是整数类型。分析:这道题有几个知识点:1,n分别为负数,0,正数的情况。n为负数的话,算出结果之后要被1除,同时还要考虑这时候x不能为0。n为0的时候返回值为1,但0的0次方是无意义的,应该抛出异常。2,TLE如果直接计算的话,数据一大就超时,考虑计算技巧。

2014-02-02 21:21:29 1274

基于CRF的中文地名识别研究.pdf

命名实体识别是机器翻译、信息检索、问答系统等的技术基础。中文地名识别是中文命名实体识别的一个难点。本文主要对中文地名识别进行研究,实现了条件随机域(Conditional Random Fields, CRF)与支持向量机(Support Vector Machine, SVM)相结合中文地名识别系统,并重点对条件随机域与规则相结合的中文地名识别进行了研究。

2014-02-04

统计学习方法

李航 统计学习方法 《统计学习方法》是计算机及其应用领域的一门重要的学科。《统计学习方法》全面系统地介绍了统计学习的主要方法,特别是监督学习方法,包括感知机、k近邻法、朴素贝叶斯法、决策树、逻辑斯谛回归与最大熵模型、支持向量机、提升方法、EM算法、隐马尔可夫模型和条件随机场等。

2014-01-28

空空如也

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

TA关注的人

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