- 博客(29)
- 收藏
- 关注
原创 读书笔记《机器学习》 C2
Chapter 2 Author:Single Rush 第2章 模型评估与选择 Date : 2018.3.13第2章 模型评估与选择2.1 经验误差与过拟合Summary of the Terms错误率(error rate):分类错误的样本数占样本总数的比例,即如果在m个样本中由a个样本分类错误,则错误率E=amE=amE=\frac{a}{m}。 ...
2018-03-13 21:37:51 266
原创 读书笔记《机器学习》 C1
Chapter 1 Author:Single Rush 第1章 绪论 Date : 2018.3.12绪论第一章,以西瓜为例简单介绍了机器学习的一些思想,毕竟西瓜书。 基本术语,我主要关注了两个。 类型 任务 离散值 分类(“classification”) 连续值 回归(“regression”)另外是根据训练数据是否拥有...
2018-03-13 09:55:30 351
原创 LeetCode 13. Roman to Integer
Given a roman numeral, convert it to an integer.Note: Input is guaranteed to be within the range from 1 to 3999.与之前的正好相反。 LeetCode 12. Integer to Romanclass Solution {public: int romanToInt(str
2017-09-09 10:53:32 266
原创 LeetCode 12. Integer to Roman
Given an integer, convert it to a roman numeral.Note: Input is guaranteed to be within the range from 1 to 3999.阿拉伯数字转成罗马数字。[转载]罗马数字规则 因为数字小于4000,最多4位数字。class Solution {public: string intToRoma
2017-09-09 10:45:20 249
原创 LeetCode 11. 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 two lin
2017-09-09 10:39:02 206
原创 LeetCode 472. Concatenated Words
Given a list of words (without duplicates), please write a program that returns all concatenated words in the given list of words. A concatenated word is defined as a string that is comprised entire
2017-09-08 21:25:31 299
原创 LeetCode 14. Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings.这题就是找一堆字符串中最长的公共前缀。 直接暴力求解就行。 先取第一个字符串第一个字符,看看是不是所有其他字符串的第一个字符都和它一样,如果一样就继续看第二个字符,如果不一样就退出循环。但是,这个最长的长度不能超过长度最小的
2017-09-08 20:53:02 187
原创 LeetCode 15. 3Sum
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 set must not contain duplic
2017-06-09 12:37:43 251
原创 LeetCode 9. Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space. 这个题是判断一个数是不是回文数。 需要注意的是这个数反转后可能比较大,如:1111111117<2147483647,反转后7111111111>2147483647,所以在这个题中我用了long long int去记录反转后的数。 负数因为有负
2017-06-02 11:25:59 269
原创 LeetCode 8. String to Integer (atoi)
Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input case
2017-06-02 11:05:59 228
原创 LeetCode 7. Reverse Integer
Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321这个题比较简单,就是数字逆序输出。class Solution {public: int reverse(int x) { int sign = x>=0?1:-1; int
2017-05-22 12:23:48 222
原创 LeetCode 6. ZigZag Conversion
The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H N A P L S I
2017-05-21 15:03:15 196
原创 LeetCode 5. Longest Palindromic Substring
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example: Input: “babad” Output: “bab” Note: “aba” is also a valid answer.Exam
2017-05-21 14:17:08 191
原创 LeetCode 4. Median of Two Sorted Arrays
There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Example 1: nums1 = [1, 3]
2017-05-21 12:07:26 230
原创 LeetCode 3. Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters.Examples: Given “abcabcbb”, the answer is “abc”, which the length is 3. Given “bbbbb”, the answer is “b”, with th
2017-05-21 11:24:29 223
原创 LeetCode 2. Add Two Numbers
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it
2017-05-21 10:50:30 253
原创 LeetCode 1. Two Sum
LeetCode 1. Two Sum Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you m
2017-05-16 23:08:27 193
原创 读书笔记 《算法导论》 Appendix
Appendix Author:SingleRush 补充算法 Date : 2017.3.24 [TOC]补充算法回文串Manacher算法:未完待续
2017-03-24 10:20:44 622
原创 读书笔记 《算法导论》 C15
Chapter 15 Author:Single Rush Dynamic programming —— 动态规划 Date : 2017.3.24动态规划DP动态规划,是求解最优化问题的一种方法,将一个问题分成一个个子问题,将每次求解时重叠子问题进行记录,这样每个子问题只需要求解一次,极大地减小了时间复杂度,因此也被称为记忆化搜索,但与搜索又有着截然不同的本征。 如何用动态规划解题,本文
2017-03-24 10:17:13 635
原创 读书笔记 《算法导论》 C6、7、8
Chapter 6、7、8 Author:Single Rush 排序(Sorting) Date : 2017.3.24排序在本书的第二章中,我们就看到了两个排序算法——插入排序、归并排序。第六章、第七章、第八章我们又看到了堆排序、快速排序、计数排序、基数排序、桶排序等等。当在我们学习C语言的时候,我们接触的则是易于理解的选择排序和冒泡排序。 但是排序算法远远不止这些,在《The Art
2017-03-24 10:06:17 469
原创 读书笔记 《算法导论》 C5
Chapter 5 Author:Single Rush 概率分析和随机算法 Date : 2017.3.24概率分析和随机算法
2017-03-24 10:02:27 286
原创 读书笔记 《算法导论》 C4
Chapter 4 Author:Singlerush 分治策略 Date : 2017.3.24分治策略分治——“分而治之”,即把问题划分成一些子问题,子问题的规模小于原问题,但形式相同,逐个解决后,将子问题的解合并成原问题的解,这就是分治策略。 递归(还是应该说回溯?),递归往往与分治是紧密相连的,递归便是将问题分成一个个子问题解决后再将子问题的解合并。4.1 最大子数组问题未完待续
2017-03-24 10:00:55 276
原创 读书笔记 《算法导论》 C3
Chapter 3 Author:Single Rush 函数的增长 Date : 2017.3.24函数的增长这一章是学习《算法导论》的基础,没有这个基础,《算法导论》便是一本枯燥至极、难以理解的书,只有学好这一章才能理解为什么要这么设计、为什么不能这么设计。 未完待续
2017-03-24 09:57:21 297
原创 读书笔记 《算法导论》 C2
Chapter 2 Author:Single Rush 算法基础 Date : 2017.3.24算法基础本章由插入排序引入,但我将会把本章中的插入排序、归并排序,第六章的堆排序,第七章的快速排序,第八章的计数排序、基数排序、桶排序,以及另外一些我希望能补充进来的排序放在后面章节的笔记中一起分析。而在本章的笔记中我们重点将讲述算法的分析与设计基础。 循环不变式与算法的正确性,循环不变式将在后
2017-03-24 09:53:38 389
原创 读书笔记 《算法导论》 C1
Chapter 1 Author:Single Rush 算法在计算中的作用 Date :2017.3.24算法什么是算法,为什么算法值得研究,在计算中算法的作用是什么?这是第一章想告诉我们的。 之前,有人说一本书的精华,往往在于序言,而本书却在第一章。因为第一章,给了读者读下去的原因,即使它有近千页厚。 什么是算法?书中是这么描述的(版本不同,译文不同): 简单来说,所谓算法(alg
2017-03-24 09:46:03 307
原创 读书笔记《TAOCP》 V3 S5.1
排序Sorting排序的组合性质反序未完待续 一年三百六十五天天天码代码 还没想好怎么接 第三卷——主讲排序和查找。排序(Sorting)排序的某些重要应用: 1.解决“一起性”的问题,即把具有相同标志的所有项目连在一起。 2.匹配在两个或多个文件中的项。 3.通过键码查找信息。For instance, N个记录,每个记录RjR_{j}有一个键码KjK_{j},排序过程中
2017-03-23 19:58:02 646
原创 读书笔记 《TAOCP》 V1 S1.2
I am a slow walker,but I never walk backwards. -Abraham.Lincoln数学准备《Concrete Mathematics》(《具体数学》) -> CMath数学归纳法数学归纳法证明P(n)成立。步骤跟书上构造一个证明的步骤有所不同,其实是一样的。证明步骤置n<-1,证明P(1)成立。假设P(k)成立。基于P(k)成立,证明
2017-03-23 17:44:05 645
原创 CONTACT ME
自我介绍联系我自我介绍我是SingleRush,在CSDN记录一些我的学习感悟。联系我Mail Address: trytodiscovery@gmail.comQQ:
2017-03-23 17:24:23 823
原创 读书笔记《TAOCP》 V1 S1.1
Practice yourself, for heaven’s sake, in little things; and thence proceed to greater. -EPICTETUS算法欧几里得算法计算方法可以定义为一个四元组(Q,I,Ω\Omega,f)。四元组表示f((m,n))=(m,n,0,1)f((m,n,r,1))=(m,n,m除以n的余数,2)f((m,n
2017-03-23 17:14:53 552
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人