自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

LandscapeMi

landscapemi的博客

  • 博客(92)
  • 收藏
  • 关注

原创 复习(计算机基础)_2:内存管理

http://blog.sina.com.cn/s/blog_6720a9120100i02t.html虚拟内存是一种抽象,处于应用层的内存请求和MMU(内存管理单元)之间。进程虚拟内存处理代码段初始化数据段未初始化数据段堆栈段共享库堆内存寻址(MMU)保护模式:不再使用BIOS,而是为计算机每个硬件提高驱动实模式:BIOS必须在实模式下运行逻辑地址到物理地址的过程,是地址翻

2016-06-30 08:37:20 325

原创 关闭 leetcode_c++:哈希:Suduku_Solver(037)

题目Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character ‘.’.You may assume that there will be only one unique solution.算法O(n!) DFS(借助网上的讨论)因为题目

2016-06-28 14:19:03 437

原创 关闭 leetcode_c++:哈希:Valid Sudoku(036)

题目Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the character ‘.’.、 判断一个数独是否有效,有效的数独不强求有

2016-06-28 13:33:02 319

原创 机器学习:LDA_数学基础_5:变分推断:变分推断部分

最优化量是一个泛函时,需要研究所有的输入函数,找到最大化或者最小化泛函的函数就是变分变分近似的过程:限制需要最优化算法搜索的函数的范围(二次函数,或者,固定基曲线函数的线性组合)变分推断符号假设ZZ:所有的潜在变量和参数组成的集合XX:所有的观测变量的集合确定了联合分布p(X,Z)p(X,Z)目标:找到后验概率分布 p(Z|X)p(Z|X), 验证模型证据p(X)p(X) 的近似公式

2016-06-26 22:18:21 1575

原创 leetcode_c++:哈希:Substring with Concatenation of All Words(030)

题目You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and w

2016-06-26 14:35:34 208

原创 复习(数据结构):线性表 : C:动态分配内存

#define LIST_INIT_SIZE 10#define LIST_INCREMENT 2struct SqList{ ElemType *elem; //存储空间的基地址 int length; int listsize; //当前分配的存储容量};//初始化//构建空的线性表void InitList(SqList &L){ L.elem=(Ele

2016-06-26 10:18:40 534

原创 机器学习:LDA_数学基础_4:变分推断:EM基础

导论参数估计的方法给定样本{x1,...xn}\{x_1,...x_n\},求参数 θ\theta 极大似然估计极大后验估计若存在隐变量 EM算法采样变分选择一个容易计算的近似分布q(x)q(x),使其尽可能的接近后验分布p(x|D)p(x|D)变分法分布的相似度 假定p∗(x)p^*(x)是真实(难解的)分布,q(x)q(x)是某个近似(容易解得)

2016-06-26 06:56:34 2549

原创 推荐算法:基于图的算法:基于路相似度_续

最短路径的方法@@@Horting Hatchers an Egg:A new graph-theoretic approach o coll计算用户u到其他用户v的最短路。 最短路径的计算:用户A,horts,用户B(A,B对相同的物品评过分) 满足一个可预测性的关系,就是吧将用户u和用户v的评分尺度,做映射 最后,计算u到其他队物品j评分过的用户的路径上。计算路径 同时将路径转换为刻度表

2016-06-25 17:01:01 1555

原创 leetcode_c++:哈希:Longest Substring Without Repeating Characters(003)

题目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 the

2016-06-25 13:39:53 221

原创 复习(java):语法:面向对象

1. 类和对象封装,继承,多态public class Person{ //定义两个成员变量 public Sting name; public int age; public void say(String content){ System.out.println(comtent); }}Person p=new Person();p.n

2016-06-25 11:51:22 402

原创 复习(数据结构):线性表 : C

代码数据结构typedef struct{ ElemType data[MAXSIZE]; int length; //当前线性表的长度}SqList;初始化线性表//初始化线性表Status InitList(SqList *L){ L->length=0; return OK;}//置空线性表Status ClearList(SqList *L){

2016-06-25 10:09:18 787

原创 复习(数据结构:java):线性表(数组):基础类设计

ArrayIntList类的设计1. 设计使用该类的方法 (简单版本)

2016-06-24 17:01:09 350

原创 leetcode_c++:Game of Life(289)

题目According to the Wikipedia’s article: “The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970.”Given a board with m by n

2016-06-24 14:49:15 336

原创 leetcode_c++:Find the Duplicate Number(287)

题目Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate number, f

2016-06-24 13:26:01 288

原创 复习(计算机基础)_1:体系结构

知识点总结1. 系统概述冯·诺依曼机:将数据和指令都存储在存储器中的计算机。 哈佛机:为数据和程序提供了各自独立的存储器。 计算机的性能指标 a- 机器字长 b- 数据通信宽带 c- 主存容量 d- 运算速度 吞吐量和相应时间主频和cpu周期cpui:执行一条指令所需的时间cpu执行时间:运行一个程序所花费的时间MIPS:每秒执行百万条指令MFLOPS:每秒执行百万次浮点

2016-06-22 09:28:33 342

原创 leetcode_c++:Move Zeroes(283)

题目Given an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1, 0, 3, 12], after calling your fun

2016-06-19 12:30:22 293

原创 leetcode_c++:Missing Number(268)

题目Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing from the array.For example, Given nums = [0, 1, 3] return 2. Note: Your algorithm should run in

2016-06-19 12:24:34 413

原创 leetcode_c++:Product of Array Except Self(238)

题目Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Solve it without division and in O(n).For

2016-06-19 11:32:18 232

原创 leetcode_c++:Majority Element II (229)

题目Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space.算法http://blog.csdn.net/xudli/article/details/4678414

2016-06-19 11:25:49 369

原创 复习(数据结构):复杂度

http://blog.csdn.net/mijian1207mijian/article/details/50383481

2016-06-19 11:02:06 243

原创 推荐算法:基于图的算法:基于路相似度

图中两个节点的距离,通过计算,用于连接两个节点的路径的数目和这些路径的长度所构成的函数来获得。

2016-06-18 21:10:04 618

原创 cc150:哈希:基础

hashsethashmap

2016-06-18 17:04:42 188

原创 cc150:字符串:1.8

题目假定有一个方法isSubstring,可检查一个单词是否为其他字符串的子串。给定两字符串s1和s2,请编写代码检查s2是否是s1旋转而成,要求只可以调用一次isSubstring 。例如:waterbottle和erbottlewat算法是的话,则: S1=XY=WATERBOTTLE X=WAT Y=ERBOLLLE S2=YX=ERBOTTLEWATyx肯定是xyxy的子串impo

2016-06-18 15:47:44 243

原创 leetcode_c++:Summary Ranges(228)

题目Given a sorted integer array without duplicates, return the summary of its ranges.For example, given [0,1,2,4,5,7], return [“0->2”,”4->5”,”7”].给一个数组,求里面的自然递增序列 就是直接判断是否是上一个+1直接for,则最后一个递增区间需要在for外面

2016-06-18 14:12:30 204

原创 leetcode_c++:Contains Duplicate II(219)

题目Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between i and j is at most k.数组中是否有重复,

2016-06-18 13:33:40 504

原创 leetcode_c++:Contains Duplicate(217)

题目Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element i

2016-06-18 12:40:29 425

原创 leetcode_c++:Combination Sum III(216)

题目Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers.Example 1:Input: k = 3, n

2016-06-18 11:59:55 261

原创 leetcode_c++:Minimum Size Subarray Sum (209)

题目Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn’t one, return 0 instead.For example, given the array [2,3,1,2,

2016-06-18 11:51:08 205

原创 cc150:字符串:1.5

题目利用字符重复出现的次数,编写一个方法,实现基本的字符串压缩功能,“aabccccaaa”变成“a2b3c4a3”。如果压缩后字符串长度没有变短,则返回原型的字符算法(c++)https://github.com/zhoulike/algorithms/blob/master/cc150/1.5.cpp算法https://www.snip2code.com/Snippet/253088/CC150

2016-06-17 11:56:10 418

原创 cc150:字符串:1.4

题目编程写程序,将空格全部替换为”%20”。假设字符串尾部有足够的空间存放字符串。并且知道字符串的长度算法扫描两次第一次扫描有多少空格,计算出所需要的长度第二次扫描开始从反向(从后向前)编辑字符串 http://blog.csdn.net/believejava/article/details/38682361 http://blog.csdn.net/believejava/articl

2016-06-16 23:12:44 249

原创 cc150:字符串:1.3

题目给定两个字符串,编写程序,确定其中一个字符串的字符重新排列后,能否变成另一个字符串。算法排序字符串 两个单词互为变位词,那么排序后,就会相同,所以先对字符串排序,然后比较class Solution{private String sort(String s){ char[] content=s.toCharArray(); Arrays.sort(content);

2016-06-16 15:01:13 481

原创 cc150:字符串:1.1

题目实现一个算法,确定一个字符串的所有字符是否不同。不允许使用额外的数据结构。算法使用布尔数组 时间复杂度:O(N) 空间复杂度:O(1)class Solution{ public static boolean isUniqueChar2(String str){ if(str.length()>256) return false; boolean[]

2016-06-16 11:56:48 267

原创 cc150:字符串:基础

string对象是不可以改变的,任何string中看起来会改变string的方法,其实都是创建了一个新的stringstring中的“+”操作,因为string是不可以变的对象,所以未直接使用,而是使用了stringbuilder类来优化StringBufferinsert,replace,substring,reverse,append,toString,delete格式化的输出Syste

2016-06-16 11:07:17 726

原创 推荐算法:基于图的算法:pagerank

基本模型*随机游走模型针对浏览网页的用户行为建立的抽象模型直接跳转:打开浏览器,输入网址,然后根据链接跳转转移概率矩阵 则可以组织这样一个N维矩阵:其中i行j列的值表示用户从页面j转到页面i的概率 M=⎡⎣⎢⎢⎢⎢01/31/31/31/201/2000011/21/200[AA,BA,CA,DA][AB,BB,CB,DB][AC,BC,CC,DC][AD,BD,CD,DD]⎤⎦⎥⎥⎥⎥M=

2016-06-15 23:27:04 4461

原创 leetcode_c++:Majority Element(169)

题目Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority element alway

2016-06-15 00:38:44 278

原创 leetcode_c++:Find Peak Element(162)

题目A peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak element and return its index.The array may contain multiple peaks, in that ca

2016-06-14 23:44:23 446

原创 推荐算法:基于内容的推荐_1:内容推荐算法

基于内容的推荐:推荐给用户他们过去喜欢的类似产品;基于CF的推荐,识别出具有相同爱好的用户,给他们推产品基于内容的推荐算法基于内容推荐的步骤对数据内容分析,得到物品的结构化描述分析用户过去的评分或评论过的物品的,作为用户的训练样本生成用户画像 a.可以是统计的结果(后面使用相似度计算) b.也可以是一个预测模型(后面使用分类预测计算)新的物品到来,分析新物品的物品画像利用用户画像构

2016-06-14 13:59:30 9520

原创 cc150:数组:1.7

题目若M*N的矩阵中某个元素为0,则将其所在的行列清零 要求:空间复杂度是O(1)算法找出第一个0元素然后利用第一个0元素的行列来记录其余零元素的行列根据第一个0元素所在的行列的记录情况,清零(参看进军硅谷P96页) 1 0 3 4 5 6 0 8 9 10 11 12=>记录 1 0 0 4 5 0 0 8

2016-06-14 13:58:46 296

原创 cc150:数组:1.6

代码1.6 题目给定一副N*N的图像,其中每个像素的大小为4个字节,编写一种方法,将图像旋转90度。不占用额外内存空间能否做到?算法复杂度:O(n^2) * 一圈一圈的转,一个一个的交换 https://yq.aliyun.com/articles/3878 http://www.2cto.com/kf/201410/341031.html http://www.a

2016-06-13 23:35:01 249

原创 cc150:数组:基础

语法细节数组标示是引用,指向堆上创建的一个真实对象不像c++,函数不可以返回数组。java可以直接返回数组Arrays类方法a.equals b.fill c.sort d.binarySearch e.toString f.hashCode( 产生数组的散列码)数组元素的比较comparable接口 a.java.lang.Comparable接口 b.此接口只有compar

2016-06-13 11:50:50 249

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除