- 博客(9)
- 收藏
- 关注
原创 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 = "
2014-07-22 23:53:16 786
原创 leetcode-Substring with Concatenation of All Words
You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and without an
2014-07-20 18:18:00 971
原创 C++<algorithm>中sort的比较函数写法
定义排序函数:方法1bool Less(const Student& s1, const Student& s2){return s1.name }std::sort(sutVector.begin(), stuVector.end(), Less);或者bool operator{return s1.name }std::sort(sutV
2014-07-13 14:17:42 16489 1
原创 leetcode-Largest Rectangle in Histogram
Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.Above is a histogram where width o
2014-07-09 00:21:58 799
转载 字符串匹配的KMP算法
字符串匹配是计算机的基本任务之一。举例来说,有一个字符串"BBC ABCDAB ABCDABCDABDE",我想知道,里面是否包含另一个字符串"ABCDABD"?许多算法可以完成这个任务,Knuth-Morris-Pratt算法(简称KMP)是最常用的之一。它以三个发明者命名,起头的那个K就是著名科学家Donald Knuth。这种算法不太容易理解,网上
2014-07-07 13:47:08 682
原创 leetcode-Distinct Subsequences
Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed from the original string by deleting some (can be non
2014-07-06 16:18:56 760
原创 leetcode-Copy List with Random Pointer
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy of the list.题意:拷贝一个带有随机指针的单链表
2014-07-06 14:27:05 1362
原创 leetcode-Container With Most Water
Container With Most Water Total Accepted: 11787 Total Submissions: 38592My SubmissionsGiven n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai)
2014-07-05 23:33:29 782
转载 如何选择机器学习分类器?
你知道如何为你的分类问题选择合适的机器学习算法吗?当然,如果你真正关心准确率,那么最佳方法是测试各种不同的算法(同时还要确保对每个算法测试不同参数),然后通过交叉验证选择最好的一个。但是,如果你只是为你的问题寻找一个“足够好”的算法,或者一个起点,这里有一些我这些年发现的还不错的一般准则。你的训练集有多大?如果训练集很小,那么高偏差/低方差分类器(如朴素贝叶斯分类器)要优于低偏差/高方差分
2014-07-03 14:46:00 1506
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人