自定义博客皮肤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的博客

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

原创 leetcode_c++:Insert Intervals(057)

题目Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start times.Example

2016-05-31 22:52:58 208

原创 leetcode_c++:Merge_Intervals(056)

题目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].算法复杂度:O(nm)#include<iostream>#include<vector>#include <

2016-05-31 22:44:28 607

原创 机器学习:主题模型:PLSA

http://blog.csdn.net/pipisorry/article/details/42560877 * 概率潜在语义分析简称pLSA(Probabilisticlatent semantic analysis) * 概率潜在语义分析与标准潜在语义分析的不同是,标准潜在语义分析是以共现表(就是共现的矩阵)的奇异值分解的形式表现的,而概率潜在语义分析却是基于派生自LCM的混合矩阵

2016-05-31 14:39:13 774

原创 机器学习:主题模型:LSA

空间向量模型的缺点http://blog.csdn.net/pipisorry/article/details/42560331Term-Document矩阵 上图是一个Term-Document矩阵,X代表该单词出现在对应的文件里,星号表示该词出现在查询(Query)中,当用户输入查询”IDF in computer-based information look up” 时,用户是希望查找与信息

2016-05-31 14:00:12 2083

原创 leetcode_c++: Jump Game(055)

题目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.Determine i

2016-05-31 01:21:12 454

原创 leetcode_c++:Spiral Matrix(054)

题目Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example, Given the following matrix:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ] You

2016-05-31 00:15:37 243

原创 推荐算法:协调过滤初级_2:基于领域的方法

协同过滤 基于领域的方法 @@@Empirical analysis of predictive algorithms for collabotive filtering (a) user-based @@@ GroupLens:applying collative filtering to Usenet news @@@Recommending and Evaluting chices

2016-05-30 13:37:43 1134

原创 推荐算法:协调过滤初级_1:简介

推荐系统:定义为评估用户对新物品的反馈三种反馈: 分级反馈二元反馈一元反馈问题定义用户:uu;物品集合:TT;系统评分集合:RR;可选分数集合:SS用户uu对于物品ii的评分:ruir_{ui}已经对物品ii评分的uu的集合:uiu_i用户uu 所评价的物品集合: TuT_u同时被用户uu和vv评价过的集合 :TuvT_{uv}对物品ii和jj都评分的用户集合:u

2016-05-30 11:35:02 561

原创 推荐算法:基于内容的推荐_4: 趋势

社会化标签略(后面分析)惊喜度基于内容推荐惊喜度低:推荐和用户评价过的类似的产品

2016-05-29 22:24:43 379

原创 推荐算法:基于内容的推荐_3: 用户特征

概率方法和贝叶斯贝叶斯分类器@@@some effective techniques for naive bayes text classification @@@Integrating tags in a semantic content-based recommender相关反馈和Rocchio算法允许用户给推荐系统根据用户的信息需求推荐的文本打分 http://blog.sina.c

2016-05-29 22:21:10 492

原创 推荐算法:基于内容的推荐_2: 物品的表示

挖局用户曾经喜欢的物品,推荐类似的产品利用已知的用户自己的偏好,兴趣等属性和物品内容属性做匹配将用户的个人信息的特征和内容对象的特征匹配,结果就是用户对某个对象感兴趣的程度基于内容推荐的层次结构* 内容分析器文档的数据处理得到结构化的数据,存储在物品库中* 信息学习器收集有关用户偏好的数据特征,泛华这些数据,构建用户特征信息(机器学习)通过历史数据构建用户兴趣模型生成兴趣特征和无兴

2016-05-29 12:34:37 1505

原创 推荐算法:基于内容的推荐_0:信息检索

信息检索:给定用户关键字,如何从相关性的角度对网页排序 * 布尔模型 * 向量空间模型 * 概率模型 * 语言模型 * 机器学习排序

2016-05-25 22:31:19 718

原创 推荐算法的文献综述

提纲从netflix大赛开始推荐系统的定义推荐算法的历史推荐系统的算法综述推荐系统的应用推荐系统的比赛推荐系统的发展Netflix大赛

2016-05-25 00:11:05 4708

原创 leetcode_c++:Maximum Subarray(053)

题目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,1] has t

2016-05-24 00:52:24 423

原创 leetcode_c++:Rotate Image(048)

题目You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up: Could you do this in-place?算法复杂度:O(n^2)对角线swap行反转class Solution {public: void rot

2016-05-23 23:02:40 305

原创 leetcode_c++:Jump Game II(045)

题目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.Your goal is to re

2016-05-23 22:43:57 349

原创 推荐算法:基本技术

数据预处理相似度距离相似度d(x,y)=∑nk=1(xk−yk)2−−−−−−−−−−−−−√d(x,y)=\sqrt{\sum_{k=1}^n(x_k-y_k)^2}余弦相似度

2016-05-23 15:21:46 393

原创 leetcode_c++:trappint rain water(042)

题目Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1,0,1,3,2,1,2,1], r

2016-05-23 01:21:45 233

原创 leetcode_c++:First Missing Positive(041)

题目Given an unsorted integer array, find the first missing positive integer.For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2.Your algorithm should run in O(n) time and uses constant space.

2016-05-23 00:28:48 323

原创 leetcode_c++:Combination Sum_2(040)

题目Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each number in C may only be used once in the combination.

2016-05-23 00:08:02 377

原创 leetcode_c++:Combination Sum(039)

题目Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen from C unlimited numb

2016-05-22 23:55:06 526

原创 面试:数组:旋转矩阵

题目给第一个m*n的矩阵,按螺旋顺序返回所有元素算法越界的判断方法import java.util.*;public class Solution{ public ArrayList<Integer> spiralOrder(int[][] matrix){ ArrayList<Integer> result=new ArrayList<Integer>();

2016-05-20 16:36:16 504

原创 面试:数组:矩阵清零

题目给定一个矩阵,若某元素为0,则将该元素的行和列清零算法找到第一个0元素,使用该元素的行来记录需要清零的列,该元素的列记录需要清零的行 再扫描,一次清零

2016-05-20 16:26:46 463

原创 推荐算法:综述

长尾理论马太效应问题打分预测Top-N推荐算法发展* GroupLens研究小组对MovieLen电源推荐系统用户对喜欢的电影打分分析用户对电影的兴趣推荐给他们喜欢却未打分的电源* Amazon将推荐应用到电子商务通过分析用户的购买浏览,预测用户可能对什么感兴趣销售额提高了30%* Acm Conference on Recommender System* Netflix大赛

2016-05-20 14:15:04 608

原创 面试:数组:插入位置

题目给定一个有序数组和一个目标值,返回目标值的下标。如果目标值不在序列则返回其插入数组后的下标值,插入后的数组依然保持有序。 数组不存在重复的数字算法二分查找的最后结果是low>high的时候循环结束,low记录了第一个大于目标值的元素的下标import java.util.*;public class Solution{ public int searchInsert(int[] A,i

2016-05-19 18:18:43 213

原创 面试:数组:区间搜索

题目给定一个区间和目标值,找出目标值的起始下标,若无目标值,则返回[-1,-1] 要求时间复杂度是O(lgn)算法找到比目标值小的最大值,下一步是目标值找到比目标值大的最小值,上一步是目标值import java.util.*;public class Solution{ public int[] searchRange(int[] A,int target){ in

2016-05-19 17:30:14 243

原创 面试:数组:二维搜索数组

题目对一个n*n矩阵进行搜索,矩阵有如下特征 1. 每行的是从左到右都是排序的 2. 每行的首数大于尾数二分查找A是m*n的矩阵A[k]=matrix[i][j]i=k/nj=k%n复杂度O(lg(m*n))import java.util.*;public class Solution{ public boolean searchMatrix(int[][] matrix,i

2016-05-19 17:15:17 233

原创 面试:数组:三角形

题目给定一个正整数n, 产生Pascal三角形的前n行算法每行首位是1中间元素是上一行相邻两个元素的和。import java.util.*;public class Solution{ public ArrayList<ArrayList<Integer> > pascalTriangle(int n){ ArrayList<ArrayList<Integer> >

2016-05-18 17:12:07 626

原创 leetcode_c++:Search insert position(035)

题目Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.Her

2016-05-18 01:09:38 205

原创 leetcode_c++:Search for a Range(034)

题目Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm’s runtime complexity must be in the order of O(log n).If the target is not found in the

2016-05-18 00:45:22 572

原创 leetcode_c++:Search in Rotated Sorted Array(033)

题目Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If found in the array return its ind

2016-05-17 22:59:43 236

原创 面试:数组:合并有序数组

题目给定两个有序数组A和B,把B合并到A,保持结果有序。假设A有足够的空间可以容纳B,初始时,A和B的元素各有m和n个。算法反向插入和移动数组import java.util.*;class Solution{ public void mergeTwoMergeSortedArrays(int[] A,int m,int[] B,int n){ while(n>0){

2016-05-15 17:14:48 202

原创 面试:数组: 首个正数

题目给定一个无序的整型数组,找出第一个不在数组里的正整数。要求时间复杂度是 O (n),空间复杂度是O(1)例子 输入数组{5,3,-1,1} 返回 2 算法借助哈希思想数组小标存储相应的值: A[K-1]=K对于大于数组长度和小于1的数字抛弃;有了新数组就从头开始,遇到第一个A[k-1] 不等于k的,则输出k如果没有遇到只能是数组长度的下一个整数 {1,2,3,4} ;则返回

2016-05-15 17:07:57 239

原创 面试:数组:旋转数组搜索

题目给定一个有序数组的旋转和一个目标值,返回其目标值在该数组的下标。如果不存在,那么返回-1。假设数组没有重复的值。算法二份查找 O(lgN)import java.util.*;class Solution{ public int searchRotateArray(int[] A,int target){ int left=0; int right=A.

2016-05-15 16:30:57 356

原创 面试:数组:旋转数组的最小值

题目输入一个递增排序数列的一个旋转,输出旋转数组的最小值算法:局部有序二分查找特殊情况 {1,1,1,0,0,1,1} 无法区分哪个部分已经排序,只能把首部指针向前移动一位。复杂度o(lgN)import java.util.*;class Solution{ public int getMinOfRotation(int[] A){ int left=0,rig

2016-05-15 16:23:00 212

原创 面试:数组:两数组中的中序数

题目给定一维整形数组和一个整数看,找出不小于k的数目最小的子数组算法parttion,数组一份为二,转换为topk需要对partition做降序排列分区的同时计算左边数的和这里写代码片

2016-05-15 16:05:30 332

原创 面试:数组:Topk _1

题目 求一维数组中最小的k个数字 算法_1:快排算法 复杂度:O(klgn)import java.util.*;class Solution{ //选择一个数,将数组分为大小两个部分 public int partition(int data[],int start,int end){ int pivotvalue=data[start];

2016-05-14 23:50:28 848

原创 leetcode_c++:Next Permutation (031)

题目Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible or

2016-05-13 00:54:27 393

原创 leetcode_c++:Remove Element (027)

题目Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in place with constant memory.The ord

2016-05-13 00:08:40 193

原创 leetcode_c++:Remove Duplicates from Sorted Array(026)

题目Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with c

2016-05-11 23:39:42 219

空空如也

空空如也

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

TA关注的人

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