自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 【NLP】维特比算法

寻找最可能的隐藏状态序列 (Finding most probable sequence of hidden states) 对于一个特殊的隐马尔科夫模型(HMM)及一个相应的观察序列,我们常常希望能找到生成此序列最可能的隐藏状态序列。 之前的那个问题变转,http://blog.csdn.net/jeiwt/article/details/8076019   假设

2014-12-25 15:26:48 428

转载 【Leetcode】Grey Code

【题目】 The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total number of bits in the code, print the se

2014-12-24 23:36:22 325

原创 【Leetcode】integer to Roman

【题目】 Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 【分析】 只要是遵守那个转换规则就好吧。然后就是数学处理。 【代码1】 private static LinkedHashMap numToRoman

2014-12-24 18:58:12 241

原创 【LeetCode】Majority Numbers

【题目】 Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the array is non-empty and the majorit

2014-12-24 10:22:30 269

原创 【Leetcode】Sort Colors

【题目】 Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the

2014-12-07 10:20:07 316

转载 【Leetcode】Maximum Subarray

【题目】 Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [−2,1,−3,4,−1,2,1,−5,4], the contiguous subarray [4,

2014-12-05 17:30:17 559

原创 【LeetCode】Search Insert Position

【题目】 Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You may assume no duplicates in th

2014-12-05 17:05:33 234

转载 二叉树遍历神招——morris Traversal

morris traversal 原理很简单,利用所有叶子结点的right 指针,指向其后继结点,组成一个环,在第二次遍历到这个结点时,由于其左子树已经遍历完了,则访问该结点 如下图为morris 的一个示例 【morris中序遍历】 void bst_morris_inorder(struct bst_node *root) { struct bst_n

2014-12-04 17:31:43 462

原创 【Leetcode】Binary Tree Inorder Traversal

【题目】 Given a binary tree, return the inorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [1,3,2]. Note: Recursi

2014-12-04 16:22:20 243

原创 【LeetCode】Linked List Cycle

【题目】 Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? 【分析】 使用two pointer的思想,因为如果一个list存在环的话,那个两个pointer必定会相遇!~ 经过各种改进之后!~ 写出的

2014-12-04 13:40:55 300

原创 【LeetCode】Unique Binary Search Tree

【题目】 Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example, Given n = 3, there are a total of 5 unique BST's. 1 3 3 2

2014-12-04 13:37:50 306

原创 【LeetCode】Single Number

【题目】 Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without u

2014-12-04 10:22:37 285

空空如也

空空如也

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

TA关注的人

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