关闭

[LeetCode P97] Interleaving String动态规划

原题:Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example, Given: s1 = "aabcc", s2 = "dbbca",When s3 = "aadbbcbcac", return true. When s3 = "aadbbbaccc", return false....
阅读(67) 评论(0)

[LeetCode P96] Unique Binary Search Trees II

原题:原题: Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1...n.For example, Given n = 3, your program should return all 5 unique BST's shown below. 1...
阅读(56) 评论(0)

[LeetCode P76] Minimum Window Substring

原题:Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example, S = "ADOBECODEBANC" T = "ABC" Minimum window is "BANC".Note:...
阅读(50) 评论(0)

[LeetCode P72] 编辑距离Levenshtein Distance算法[经典动态规划]

突然就写到72题了…中间也遇到了一些难题,60~70的题目有好几题坑题,不过Unique Path里有一题挺不错的,我想用迷宫回溯的方法求解,发现时间越界,其实也是用DP,有空放上来。 原题:Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (e...
阅读(80) 评论(0)

[LeetCode P45] 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 r...
阅读(68) 评论(0)

[LeetCode P41] First Missing Positive

原题:Given an unsorted integer array, find the first missing positive integer.For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2.Your algorithm should run in O(n) time and uses constant space.解...
阅读(58) 评论(0)

[LeetCode 37] Sudoku Solver回溯解法

原题:Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character '.'.You may assume that there will be only one unique solution.解决一个数独,我认为还是比较直观的,一直觉得计算...
阅读(103) 评论(0)

[LeetCode P32] Longest Valid Parentheses 四种解法

又是一道Hard题,但AC却很简单,用暴力算法,大概5-10分钟就搞定了,比较难的是这题有很多种解法,把这些解法都理解一遍比较好。四种解法都做了注释,可以直接看代码。/* 原题: Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) p...
阅读(118) 评论(0)

[Leetcode P28] Implement strStr()(KMP算法)

原题:Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.刚看到这题,我就放了个string.find()上去:return haystack.find(needle);完美AC。 但是转念一想,这题虽然...
阅读(176) 评论(0)

[Leetcode P17] Letter Combinations of a Phone Number(看作递增加法器)

原题:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below.(一个手机的九宫格)虽然这题不是很难,但是我...
阅读(87) 评论(0)

[Leetcode P15] Three Sum 三数之和

很有意思的问题,也让我重新看了一下第一题。 原题:Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: The solution s...
阅读(94) 评论(0)

[Leetcode P11]Container With Most Water

原题: Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find t...
阅读(97) 评论(0)

[Leetcode P10]Regular Expression Matching 正则匹配

总共用了两种解法,一种是我自己递归求解的,效率很低,边界条件很难理清楚,代码很长,第二种是DP解法,把递归的子问题的解存到一个数组里,代码很短。 1. 递归解法 主要想法是根据当前的正则表达式,来决定接下去如何匹配,我们可以用两个字符串的子串去匹配,麻烦的是,可能相同的子字符串被求解了很多遍,特别是.*对应的字符串需要循环求解。写完这个解法以后,我很自然地就知道可以用DP递归求解了,不过...
阅读(116) 评论(0)

BayesWipe: A Scalable Probabilistic Framework 论文笔记及其错误

这是论文BayesWipe的阅读笔记,这是一个数据清洗系统,论文发表在JDIQ,这个期刊比较新,使用了概率图模型中的BBN来做,算是一个比较新的将机器学习融入数据清洗的系统,但是我认为其似然也就是P(T|T*)的计算是有问题的,读者可以仔细推敲一下: P(T|T*)P(T*)=P(T*|T)P(T) (1) 这个公式是成立的,一个前提条件是T和T*互相在C集合中,那么作者在清洗T的时候用到了的...
阅读(136) 评论(0)

BigDansing: A System for Big Data Cleansing论文笔记

这是BigDansing这篇论文的一些笔记,希望对您有所帮助。 1.基础 Semantics                Detect        GenFix                     v                v ->UDF->Violation->Possible Fixes UDF U:用户自定义的关系 D:拒绝约束(t1,t2=>...
阅读(152) 评论(0)
19条 共2页1 2 下一页 尾页
    个人资料
    • 访问:2530次
    • 积分:213
    • 等级:
    • 排名:千里之外
    • 原创:17篇
    • 转载:0篇
    • 译文:0篇
    • 评论:0条
    文章分类
    文章存档