- 博客(33)
- 收藏
- 关注
原创 Kalman Filter
Kalman Filter1 Linear Optimal Filtering2 Orthogonality Principle4 State Model5 Objective And HypothesisObjectiveHypothesisRemark3 NotationsRemarkPropositionConclusion of Space RelationshipT
2017-05-21 15:33:40
513
原创 Leetcode-DSF-Scramble String
思路ProblemCode思路此题有两难。 其一规律很难找寻,寻找scramble string 之间的关系需要敏锐的眼光。 没有快捷的算法,stack, DP, DC等等行不通,需尝试最傻的方法DSF。 ProblemGiven a string s1, we may represent it as a binary tree by partitioning it to t
2017-05-12 11:02:28
371
原创 Leetcode-2D Dynamic Programming
97. Interleaving StringGiven 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
2017-05-04 00:45:34
300
原创 Leetcode-Reverse words in string
Given an input string, reverse the string word by word.For example, Given s = “the sky is blue”, return “blue is sky the”.Update (2015-02-12): For C programmers: Try to solve it in-place in O(1) s
2017-05-03 23:45:40
273
原创 Newto-Raphson
Newton-Raphson一阶形式推导过程二阶形式推导过程Convex FunctionQuadratic Program1. Newton-Raphson解决f(x)=0f(x)=0问题的逼近方式一阶形式xnew=xold−f(x)f′(x)f′(x)=∂f(x)∂xx^{new} = x^{old}-\frac{f(x)}{f'(x)}\\f'(x) = \frac{\par
2017-05-03 22:38:10
320
原创 Iterative Reweighted Least Squares
逼近 approximation加权最小二乘weighted least squared error approximation逼近其他范式IRLS逼近 lpl_p normOverdetermined system N pAlgebra 方法IRLS for Logit RegressionModeling本文基于这篇paper。逼近 (approximation)对于线性的问题,
2017-05-03 21:27:21
2807
1
原创 Leetcode-Recover Binary Search Tree
Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note: A solution using O(n) space is pretty straight forward. Could you devise a const
2017-05-03 10:41:55
228
原创 TCP/IP
TCP 与 UDP的区别 TCP面向连接(如打电话要先拨号建立连接);UDP是无连接的,即发送数据之前不需要建立连接 TCP提供可靠的服务。也就是说,通过TCP连接传送的数据,无差错,不丢失,不重复,且按序到达;UDP尽最大努力交付,即不保 证可靠交付 TCP面向字节流,实际上是TCP把数据看成一连串无结构的字节流;UDP是面向报文的 UDP没有拥塞控制,因此网络出现拥塞
2017-04-28 23:45:17
574
原创 g++
各种flag生成静态和动态链接库的方法静态链接库 a动态链接库 so各种flag-L Library directive. 链接库的文件夹,分别是动态和静态链接库: shared library directive containing xx.so 动态链接库 archive fie directive including xx.a 静态链接库-l Link the li
2017-04-28 16:07:29
227
原创 ESL-ICA
Independent Component AnalysisICA Maximum LikelihoodSigmoid functionFastICAWhitenPython ImplementIndependent Component Analysis假设x∈ℝp×1x\in \mathbb{R}^{p\times 1}是观测直,s∈ℝp×1s\in \mathbb{R}^{p\tim
2017-04-27 01:20:04
857
原创 Gap Statistic 间隔统计量
Gap Statistic聚类的紧支测度 measure of the compactness间隔统计量GSPython 实现测试Gap StatisticGap statistic由Tibshirani等人提出,用以解决聚类问题确定所判定类的数目。聚类的紧支测度 (measure of the compactness)最简单的方法是使用类内样本点之间的欧式距离来表示,记为DkD_k,DKD
2017-04-26 01:44:03
24884
7
原创 Leetcode-Graph-Hash
133. Clone GraphClone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ’s undirected graph serialization: Nodes are labeled uniquely.We use # as a separator f
2017-04-25 19:54:22
369
转载 平衡二叉树
AVL http://blog.youkuaiyun.com/whucyl/article/details/17289841 RBT http://blog.youkuaiyun.com/whucyl/article/details/17254801
2017-04-23 13:33:23
188
转载 BST 遍历
递归遍历pre_order// 递归先序遍历 void rpre_order(btree* tree) { btNode * p = tree; if (NULL == p) { return; } cout << p->data << " "; rpre_order(p->left); rpre_or
2017-04-23 10:41:35
349
原创 Linux-Pthread
Detach当其他线程调用exit(),分离的线程将会收到影响而终止。Zombie 僵尸线程Not Detached; Non pthread_join() or wait(); 僵尸进程是一个已经结束的进程/线程,但OS保留部分信息以备父进程查询, OS会在结束时清理僵尸进程。 僵尸进程在多进程环境下,父进程要长时间运行 ,期间可能创建子进程,然后子进程有退出时,但是父进程还在运行,这时就
2017-04-21 21:31:37
210
原创 Leetcode-Methodology-Preprocessing
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-04-21 14:26:16
211
原创 Leetcode-Hash-List(2)
Design and implement a data structure for Least Frequently Used (LFU) cache. It should support the following operations: get and put.get(key) - Get the value (will always be positive) of the key if the
2017-04-21 01:37:38
215
原创 Leetcode-List-Hash
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put.get(key) - Get the value (will always be positive) of the key if the k
2017-04-20 23:16:18
230
原创 Leetcode-DSF-Trie-Backtrack
Word Search IIGiven a 2D board and a list of words from the dictionary, find all words in the board.Each word must be constructed from letters of sequentially adjacent cell, where “adjacent” cells are
2017-04-20 14:49:50
234
原创 Leetcode-Longest Consecutive Sequence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example, Given [100, 4, 200, 1, 3, 2], The longest consecutive elements sequence is [1, 2, 3, 4].
2017-04-20 01:00:49
193
原创 Leetcode-Trie
Add and Search Word - Data structure designDesign a data structure that supports the following two operations:void addWord(word) bool search(word) search(word) can search a literal word or a regular
2017-04-20 00:35:31
257
原创 Linux-SED
Sed (Strem Editor)1. 语法普模式sed [options] {sed-commands} {input-file}批处理sed [options] -f [sed-commands-in-file] {input-file} sed [options] -e [cmd1] -e [cmd2] {input}2. 脚本执行流程R read a line into the patt
2017-04-20 00:33:29
175
原创 TLPI-Ch24
fork()In parent: returns process ID of child on success or -1 on error; in successfully created child: always returns 0. 完成对fork()调用后将存在两个进程,且每个进程都会从fork()的返回处继续执行。#include <unistd.h>#include <iostr
2017-04-16 20:04:09
402
原创 Heap-Find Median from Data Stream
Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value.Examples: [2,3,4] , the median is 3
2017-04-15 22:22:33
300
原创 Build Binary Search Tree
/* LeetCode 536. Construct Binary Tree from String* * You need to construct a binary tree from a string consisting of parenthesis and integers.* * The whole input represents a binary tree. It conta
2017-04-15 16:26:13
280
转载 Linux 常用命令
关键字: linux 查进程、杀进程、起进程 1.查进程 ps命令查找与进程相关的PID号: ps a 显示现行终端机下的所有程序,包括其他用户的程序。 ps -A 显示所有程序。 ps c 列出程序时,显示每个程序真正的指令名称,而不包含路径,参数或常驻服务的标示。 ps -e 此参数的效果和指定”A”参数相同。 ps e 列出程序时,
2017-04-14 23:23:02
186
转载 Linux-Shell chmod
修改权限rwx | rwx | rwx u | g | o 分别代指自己,用户组,其他人的权限:read write excute. drwxrwxr-x chmod 语法一chmod [who] [+, -, =] [mode] xx 命令中各选项的含义为: 操作对象who可是下述字母中的任一个或者它们的组合: u 表示“用户(user)”,即文件或目录的所
2017-04-14 23:13:18
334
原创 One-by-one to solve the Sequence Problem (2)
#1399 : Shortening Sequence (from hihocoder) Stack时间限制:10000ms 单点时限:1000ms 内存限制:256MB描述There is an integer array A1, A2 …AN. Each round you may choose two adjacent integers. If their sum is an odd nu
2017-03-31 15:13:19
238
原创 One-by-one to solve the Sequence Problem (1)
One-by-one to solve the Sequence Problem (1)1400 : Composition (from hihocoder)时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Alice writes an English composition with a length of N characters. However, her
2017-03-31 15:04:22
265
原创 统计学习之---多尺度变换 MDS (Multidimensional Scaling)
Multidimensional Scaling (MDS)The idea is to find a set of k-dimensional continuous variables to representation the original data, which only contains the dis-similarity information. It is used in prob
2017-03-26 23:15:11
4623
原创 算法导论第三版-课后习题-自解
关于答案算法导论课后习题是没有官方版的,虽然可以在https://mitpress.mit.edu/sites/default/files/titles/content/Intro_to_Algo_Selected_Solutions.pdf 中找到官方给的部分答案。按照Cormen的解释,为了讲师布置作业,官方并未公布所有的答案,以便学生自己解答。前十一章答案(仅供参考)俄罗斯一
2015-08-24 17:39:35
11741
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人