08 2018 档案
摘要:The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants. A binary search tree (BST) i
阅读全文
摘要:The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of e
阅读全文
摘要:Input our current position and a destination, an online map can recommend several paths. Now your job is to recommend two paths to your user: one is t
阅读全文
摘要:Cutting an integer means to cut a K digits lone integer Z into two integers of (K/2) digits long integers A and B. For example, after cutting Z = 1673
阅读全文
摘要:Given a non-empty tree with root R, and with weight Wi assigned to each tree node Ti. The weight of a path from R to L is defined to be the sum
阅读全文
摘要:A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes
阅读全文
摘要:Recommendation system predicts the preference that a user would give to an item. Now you are asked to program a very simple recommendation system that
阅读全文
摘要:1044 Shopping in Mars(25 分) Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Ma
阅读全文
摘要:The "eight queens puzzle" is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each other. Thus, a solutio
阅读全文
摘要:When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. A socia
阅读全文
摘要:The following is from Max Howell @twitter: Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a
阅读全文
摘要:John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo -- that is, he would select winners from
阅读全文
摘要:On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the characters corresponding to those keys will appear rep
阅读全文
摘要://本学习笔记只是记录,并未有深入思考。 1.什么是数据挖掘? 数据挖掘是数据库中发现必不可少的一部分。 数据预处理主要包括(可能是最耗时的步骤): 1.融合来自多个数据源的数据 2.清洗数据以消除噪声和重复的观测值 3.选择与当前数据挖掘任务相关的记录和特征。 2.数据挖掘要解决的问题 1.可伸缩
阅读全文
摘要:Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest people. Now you are supposed to si
阅读全文
摘要:Unlike in nowadays, the way that boys and girls expressing their feelings of love was quite subtle in the early years. When a boy A had a crush on a g
阅读全文
摘要:This time your job is to fill a sequence of N positive integers into a spiral matrix in non-increasing order. A spiral matrix is filled in from the fi
阅读全文
摘要:2. Missing number 转自:https://mp.weixin.qq.com/s/WLRXLdi-3igkjtiWlHg7Ug Given a positive integer n(n≤40), pick n-1 numbers randomly from 1 to n and con
阅读全文
摘要:For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, product and quotient. Input Sp
阅读全文
摘要:Given three integers A, B and C in [−263,263], you are supposed to tell whether A+B>C. Input Specification: The first line of the input gives th
阅读全文
摘要:转自:https://blog.csdn.net/bitcarmanlee/article/details/51589143 在一篇博客中看到单变量线性回归可以使用最小二乘或者递归下降来求解,最小二乘就是最小化平方误差,解决最优化问题。 但是对其具体的过程还不是很理解,所以来总结学习一下。 1.最小
阅读全文
摘要:转自:https://mp.weixin.qq.com/s/oZVj8lxJH6ZqL4sGCXuxMw The Tower of Babylon(巴比伦塔) Perhaps you have heard of the legend of the Tower of Babylon. Nowadays
阅读全文
摘要:Formation is very important when taking a group photo. Given the rules of forming K rows with N people as the following: The number of people in each
阅读全文
摘要:If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123×105 wi
阅读全文
摘要:A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer
阅读全文
摘要:Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence { 0.1, 0.2, 0.3, 0.4 }, we
阅读全文
摘要:问题:如何求一个数二进制中的1的个数? 转自:https://blog.csdn.net/smile_zhangw/article/details/79532119 1.首先需要明确的是,一个数,可为正可为负,对正数来说,可以使用&1,>>1的操作; 但是对于负数来说,负数在内存中存在的是补码,如果
阅读全文
摘要:转自:https://blog.csdn.net/flushhip/article/details/79165701#commentBox 1.首先其中讲到了一个问题,就是如何求一个数的二进制表示的最末位的1. 用这个即可。假设x=5,那么x的二进制就是0101,-x的二进制1011.(负数补码是除
阅读全文
摘要:1057 Stack (30)(30 分) Stack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). The basic ope
阅读全文
摘要:A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find t
阅读全文
摘要:A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer
阅读全文
摘要:1.问题描述与 OCR pipeline 图1.图像文字识别流水线 首先是输入图片-》进行文字检测-》字符分割-》字符识别。 这些阶段分别需要1-5人这样子。 2.滑动窗口 主要讲滑动窗口分类器。 图2.滑动窗口检测 对于行人检测来说,矩阵框有长宽相同的比例,虽然具体的数值会变化,但比例不变;但是对
阅读全文
摘要:Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each va
阅读全文
摘要:The K−P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a program t
阅读全文
摘要:There is a classical process named partition in the famous quick sort algorithm. In this process we typically choose one element as the pivot. Then th
阅读全文
摘要:1.学习大数据集 图1.学习大数据集 当数据集量为m=1亿时,进行梯度下降将会花费较大时间。 可以使用小量数据集进行训练,然后得出学习曲线。 左图是高方差,右图是高偏差。 总之是要通过高效的学习算法来进行大数据学习。 2.随机梯度下降 图2.批梯度下降 假设是美国人口普查的数据,m=3亿,如果需要每
阅读全文
摘要:Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional
阅读全文
摘要:Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color
阅读全文
摘要:Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid "ins
阅读全文
摘要:An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any
阅读全文
摘要:A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes
阅读全文
摘要:1.问题规划 图1.推荐系统在研究什么? 例子:预测电影的评分。 当知道n_u用户数,n_m电影数;r(i,j)用户j评价了电影i,那么就是1;y(i,j)如果r(i,j)为1,那么就给出评分。 问题就是根据现有数据训练学习算法,预测未评分的电影。 2.基于内容的推荐算法 图2.基于内容的推荐系统
阅读全文
摘要:Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6,
阅读全文
摘要:To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same s
阅读全文
摘要:1068 Find More Coins (30)(30 分) Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a u
阅读全文
摘要:The task is simple: given any positive integer N, you are supposed to count the total number of 1's in the decimal form of the integers from 1 to N. F
阅读全文
摘要:Eva is trying to make her own color stripe out of a given one. She would like to keep only her favorite colors in her favorite order by cutting off th
阅读全文
摘要:1.双链表中至多只有一个结点的后继指针为空(是)。 非循环双链表最后一个结点的后继指针为空; 循环双链表没有一个结点的后继指针为空; 综上,至多只有一个。(链表结构,也就是前驱节点,后继指针,以及本节点存储信息。) 2.在用邻接表表示图时,拓扑排序算法时间复杂度为( O(n+e))。//不是O(n*
阅读全文
摘要:1040 Longest Symmetric String (25)(25 分) Given a string, you are supposed to output the length of the longest symmetric sub-string. For example, given
阅读全文
摘要:A gas station has to be built at such a location that the minimum distance between the station and any of the residential housing is as far away as po
阅读全文
摘要:1.问题动机 图1.飞机发动机检测例子 对飞机引擎的例子,如果选取了两个特征x1热量产生度,x2震动强度。并得到如下的图,如果有一个新的引擎来检测其是否正常,x_test,那么此时如果点落在和其他点正常内,那么就显示是正常,不需要进一步的检测,但是如果在右下角绿色的,那么就是异常的,需要进一步地检测
阅读全文
摘要:Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gainin
阅读全文
摘要:内容全部转自:https://blog.csdn.net/zx3517288/article/details/53363798/ 指针:与普通变量不同的是它的存储的是变量的地址。就内存的分布来说,指针和一个变量在内存中存放是没有任何区别的,无非指针存放的是变量的地址。 传值:将实参拷贝给形参,是单向
阅读全文
摘要:One way that the police finds the head of a gang is to check people's phone calls. If there is a phone call between A and B, we say that A and B is re
阅读全文
摘要:1.数据压缩 数据压缩不仅能够减小存储空间,并且能够加速学习算法。那么什么是数据压缩呢?下面给出了一个简单的例子: 图1.数据压缩的概念 举了两个例子,一个是横轴x1是厘米,纵轴特征x2是英尺,这明显是冗余的,但是在真正的实施过程中,这并不常见,这并不是一个好例子。 另一个例子是,横轴是驾驶员的技术
阅读全文
摘要:Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social n
阅读全文
摘要:Given any permutation of the numbers {0, 1, 2,..., N-1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation tha
阅读全文
摘要:A traveler's map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a progra
阅读全文
摘要:1.无监督学习概述 图1.无监督学习 有监督学习中,数据是有标签的,而无监督学习中的训练集是没有标签的,比如聚类算法。 2.k-means算法 k-means算法应用是十分广泛的聚类方法,它包括两个过程,首先是选取聚类中心,然后遍历每一个点,决定其属于哪个类;第二步是移动聚类中心点,根据刚才的聚类情
阅读全文
摘要:Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1 = { 11, 12, 13, 14 } is 1
阅读全文
摘要:1.确定执行的优先级 图1.邮件垃圾分类举例 选择100个单词作为指示是否是垃圾邮件的指标,将这些单词作为特征向量,只用0/1表示,出现多次也只用1表示,特征变量用来表示邮件。 通常情况下,会选择训练集中出现频率最多的n(在10000到50000)之间的几个单词。 图2.改进模型的建议 1.收集更多
阅读全文
摘要:Excel can sort records according to any column. Now you are supposed to imitate this function. Input Each input file contains one test case. For each
阅读全文
摘要:People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, wher
阅读全文
摘要:A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players, if there are some tables open
阅读全文
摘要:Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run sim
阅读全文
摘要:Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 2469135
阅读全文
摘要:1.如何改进性能不好的学习算法 图1.运用到测试集上效果不佳 当进行一个正则化线性回归时,最小化了代价函数得到参数,但是运用到新的测试集上,发现效果不好,那么如何改进? 1).增加训练集。但是实际上花费的时间更多,效果并不好。 2).选取更小的特征集合。 3).获取更多特征。 4).加入多项式特征项
阅读全文
摘要:1.Linear Regression with Multiple Variables 转自:https://blog.csdn.net/mupengfei6688/article/details/53098735 1.Suppose m=4 students have taken some cla
阅读全文
摘要:A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years
阅读全文
摘要:A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the
阅读全文
摘要:Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to ou
阅读全文
摘要:A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number
阅读全文
摘要:来源于:网易云课堂-哈工大-王宏志老师 1.暴力美学 问题1.布尔表达式的可满足性问题(NP完全问题) 解1.时间复杂度是2^n. 问题2.8迷问题 解2.转换为树搜索问题,对可能的移动结果生成解空间 问题3.哈密顿环问题(NP完全问题) 解3.从原点出发,对可能访问到的点生成解空间,并且从每个可以
阅读全文
浙公网安备 33010602011771号