05 2014 档案
摘要:Kepler(开普勒,1571年12月27日-1630年11月15日),德国天文学家、数学家,十七世纪科学革命的关键人物。这样一位伟大的人物在1611年遇到一个问题,他的夫人患匈牙利斑疹伤寒(Hungarian spotted feve)过世,为了照顾孩子、打理家务,Kepler 需要重新寻找一位夫...
阅读全文
摘要:一个n*m的网格,求这个网格中矩形的数目。 比如以下2*2网格,总共有9个矩形:4个1*1的矩形,4个1*2的矩形,1个2*2的矩形 算法1:动态规划,假设dp[i][j]表示以第 i 行第 j 列的格子为右下角顶点的矩形数目,那么dp[i][j] = 1 + dp[i-1][j] + dp[i][j-1] – dp[i-1][j-1] , 这里的1表示i ,j 位置的格子自身构成1...
阅读全文
摘要:题目链接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 f...
阅读全文
摘要:题目链接Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letter...
阅读全文
摘要:题目链接 Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 Have you thought about this? Here are some good questions to ask before coding. Bonus points ...
阅读全文
摘要:题目链接 You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as ...
阅读全文
摘要:题目链接Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-...
阅读全文
摘要:关于缓冲区的详细介绍,请参考 C++编程对缓冲区的理解 CPP的输入输出流和缓冲区 c++输出缓冲区刷新 (1)c++中cin、cout,cerr和c的stdin、stdout、stderr都是同步的,即iostream 对象和 and cstdio流是同步的,同步关系如下: 同步即表明我们可以在程序中混合用cout和printf或其他对应的流对。可以用std::ios_ba...
阅读全文
摘要:假设有一个文件,文件的每一行包括n个整数,整数之间以一个空格隔开,文件总共有m行,但是事先不知道n,m。如何每次从文件中读取一行整数放到一个数组中。可以分为两步:1、首先从文件中读入一行字符串,2、然后从这一行字符串中解析出整数。对于第一步,我们可以有c、c++两种风格的做法c风格:FILE *fp...
阅读全文
摘要:题目链接Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word...
阅读全文
摘要:题目链接The set[1,2,3,…,n]contains a total ofn! unique permutations.By listing and labeling all of the permutations in order,We get the following sequence...
阅读全文
摘要:根据网上的相关博客总结了一下机器学习中的这两个概念,参考博客见文末。生成模型:无穷样本==》概率密度模型 = 生成模型==》预测判别模型:有限样本==》判别函数 = 预测模型==》预测机器学习中的模型一般分为两类:判别模型、生成模型,这是对问题的两种不同的审视角度。假设我们要学习一个算法区分大象和狗...
阅读全文
摘要: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. Dete...
阅读全文
摘要:题目链接Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were ini...
阅读全文
摘要:题目链接Given a collection of intervals, merge all overlapping intervals.For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18].对若干...
阅读全文
摘要:题目链接 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,−1,2...
阅读全文
摘要:简单的以下面曲线拟合例子来讲:直线拟合后,相比原来的点偏差最大,最后一个图完全拟合了数据点偏差最小;但是拿第一个直线模型去预测未知数据,可能会相比最后一个模型更准确,因为最后一个模型过拟合了,即第一个模型的方差比最后一个模型小。一般而言高偏差意味着欠拟合,高方差意味着过拟合。他们之间有如下的关系: ...
阅读全文
摘要:How do you know what machine learning algorithm to choose for your classification problem? Of course, if you really care about accuracy, your best bet...
阅读全文
摘要:目录:一、L0,L1范数二、L2范数三、核范数今天我们聊聊机器学习中出现的非常频繁的问题:过拟合与规则化。我们先简单的来理解下常用的L0、L1、L2和核范数规则化。最后聊下规则化项参数的选择问题。这里因为篇幅比较庞大,为了不吓到大家,我将这个五个部分分成两篇博文。知识有限,以下都是我一些浅显的看法,...
阅读全文
摘要:Unique PathsA robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right a...
阅读全文

浙公网安备 33010602011771号