自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Coding for Dreams

Algorithm, NLP/IR, Data Mining, Machine Learning, Math. 个人主页: https://yangliuy.github.io/

  • 博客(414)
  • 资源 (14)
  • 收藏
  • 关注

原创 LeetCode Merge Sorted Array

Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from B. The

2015-01-27 14:34:16 1652

原创 LeetCode Merge Two Sorted Lists

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.思路分析:这题是 LeetCode Sort List需要使用的merge两个有序链表使得结果仍然有序这个子过程,详细

2015-01-27 13:43:31 1924

原创 LeetCode Sort List

Sort a linked list in O(n log n) time using constant space complexity.思路分析:这题要求在O(n log n) 和常量空间对单链表排序,O(n log n) 的排序算法有快速排序,归并排序和堆排序,对于快速排序,其最坏情况下的时间复杂读是O(n),所以不符合要求。我们可以用归并排序解决这题。用归并排序的好处是平均时间和最坏时间都

2015-01-27 13:29:49 2142 1

原创 LeetCode Unique Paths II

Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space is marked as 1 and 0 respectively in the grid.For e

2015-01-27 11:27:14 1790

原创 LeetCode Reverse Words in a String

Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".思路分析:这题算法很简单,用一个栈就可以搞定。trick part见如下的说明What constitutes a word?A sequence of non

2015-01-23 14:30:34 1942

原创 LeetCode Word Break

Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcode",dict = ["leet", "code"

2015-01-23 13:13:43 2524

原创 面试题:如何在一千万个不重复整数(电话号码)中查找某个特定数 位运算 bitmap

面试题:某城市有一千万个电话号码,如何快速找到某个电话号码,考虑优化时间和空间复杂度,同时考虑内存限制。同类变形:Given 2MB memory, we want to store 5 million integers in 0~10million range. These integers are unique.1. How to store these integers?2.Given a

2015-01-19 16:52:45 5936 2

原创 LeetCode Single Number

Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using extra mem

2015-01-19 15:39:51 1329

原创 LeetCode Linked List Cycle II

Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up:Can you solve it without using extra space?思路分析:这题比较容易想到的解法是先检查是否有环,然后检查每个node是否在环内,但是是O(N^2)的解

2015-01-19 15:00:32 1759

原创 LeetCode Linked List Cycle

Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?思路分析:这题很简单,直接用快慢指针法就可以解决,快指针速度是慢指针速度的2倍,如果有环,它们一定会相遇。AC Code/** * Definition for singly-lin

2015-01-19 14:47:40 1300

原创 LeetCode Jump Game II

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 rea

2015-01-19 14:40:52 1544

原创 LeetCode Reverse Linked List II

Reverse a linked list from position m to n. Do it in-place and in one-pass.For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->5->NULL.Note:Given m, n satisfy the following condi

2015-01-19 14:36:55 1819

原创 LeetCode Reverse Nodes in k-Group

Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is.You

2015-01-19 14:28:33 3167

原创 LeetCode Dungeon Game

The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a 2D grid. Our valiant knight (K) was initially pos

2015-01-12 15:52:30 3605

原创 LeetCode Candy

There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must have at least one candy.

2015-01-12 14:56:12 1624

原创 LeetCode Next Permutation

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 ord

2015-01-12 14:14:33 1579

原创 LeetCode Intersection of Two Linked Lists

Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a1 → a2 ↘ c

2015-01-05 07:33:08 2940

原创 LeetCode 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.Determine if you ar

2015-01-05 07:24:32 1664

原创 LeetCode Unique Paths

A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the bott

2015-01-05 07:13:37 1917 1

原创 LeetCode Find Peak Element

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 cas

2015-01-05 06:55:59 3912

原创 LeetCode First Missing Positive

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.思路分析:

2014-12-31 15:07:00 3536

原创 LeetCode Edit Distance

Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have the following 3 operations permitted on a word:a) I

2014-12-31 14:42:12 4024

原创 LeetCode Climbing Stairs

You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?思路分析:考察DP,定义ClimbWays数组,ClimbWays[n]

2014-11-29 05:25:23 1837

原创 LeetCode Search in Rotated Sorted Array

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 inde

2014-11-29 04:08:29 2242

原创 LeetCode Search Insert Position

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 inde

2014-11-29 03:35:44 1794

原创 LeetCode Maximum Product Subarray

Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,4],the contiguous subarray [2,3] has the largest produc

2014-11-29 03:00:31 1999

原创 LeetCode Permutations

Given a collection of numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1].思路分析:这题是Permutations II问题的简

2014-11-23 13:01:17 1968

原创 LeetCode Permutations II

题目 Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique permutations:[1,1,2], [1,2,1], and [2,1,1].思路分析:Pe

2014-11-23 12:56:52 2331

原创 LeetCode Merge Intervals

题目: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].思路分析:这题关键要想到先对区间排序,然后从前向后扫描,如果下一个没法合并,就添加一个区间;如果可以,还要继续向后看,

2014-11-23 11:02:09 2094

原创 LeetCode Container With Most Water

Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two

2014-11-16 10:37:08 2540 1

原创 LeetCode Generate Parentheses

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((()))", "(()())", "(())()", "()(())", "()()()"思路分析:

2014-11-16 10:28:18 2120

原创 LeetCode Gas Station

There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to its ne

2014-11-10 14:01:07 1868

转载 LeetCode 问题难度,面试出现频率及问题相关数据结构和算法

转载自http://blog.csdn.net/kenden23/article/details/14109347。统计了各个问题的难度,频率,数据结构和算法LeetCode Question Difficulty Distribution        IDQuestionDiffFreqData StructureAlgorithms                1Two Sum25arra

2014-11-09 12:52:48 9458

原创 LeetCode Two Sum

Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, where i

2014-11-09 11:36:47 2374

原创 LeetCode Validate Binary Search Tree

LeetCode Validate Binary Search TreeGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only nodes with keys

2014-11-09 11:02:57 1841

原创 LeetCode Pow(x, n)

LeetCode Pow(x, n) Implement pow(x, n).s

2014-10-30 05:41:43 2004

原创 LeetCode Maximum Subarray

LeetCode Maximum Subarray 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 su

2014-10-30 05:39:13 2176

原创 LeetCode Combinations

Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.For example,If n = 4 and k = 2, a solution is:[ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4],]

2014-10-30 05:35:09 1480

原创 LeetCode Triangle

LeetCode TriangleGiven a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2], [3

2014-10-30 05:24:45 1915

转载 CMPSCI 683 AI 第三讲 启发式搜索-A*算法

作为AI课的预习笔记,搜索了下启发式搜索 A*算法的一些经典资料,整理到下面,这个算法很有意思,有时间自己实现一下。[1] 一个老外写的A*算法实例解说,写的非常翔实易懂,这是一个中文翻译版 http://blog.csdn.net/crayondeng/article/details/12342989[2] 这个基于[1]的阅读,添加了自己的理解性的注释 http://www.cnblogs.c

2014-10-29 13:11:46 2332 1

LibSVM Java API调用示例程序

LibSVM Java API调用示例程序 Eclipse 完整工程可以运行 相关详情见http://blog.csdn.net/yangliuy/article/details/8041343#comments 3行程序搞定SVM分类-用JAVA程序调用LibSVM API 最简单的示例 欢迎关注我的博客blog.csdn.net/yangliuy

2012-12-16

基于机器学习SNS隐私向导分类器的C++及WEKA实现源码

本文接《基于机器学习的SNS隐私保护策略推荐向导的设计与实现》(详见http://blog.csdn.net/yangliuy/article/details/7628976),详细解析基于机器学习的SNS隐私策略推荐向导分类器的C++及WEKA实现与评估结果,本文完整C++程序及JAVA工程下载链接见,对数据挖掘和SNS感兴趣的朋友可以下载跑一下,有任何问题欢迎交流:)

2012-06-03

基于机器学习的SNS隐私保护策略推荐向导的设计与实现

设计一个SNS隐私保护策略推荐向导,利用机器学习方法自动计算出SNS用户的隐私保护偏好,只需要用户进行比现行SNS隐私保护机制下少得多的输入,就可以构建描述用户特定隐私偏好的机器学习模型,然后使用这个模型来自动设置用户SNS隐私保护策略。 具体的实现方法是,以用户SNS资料数据项为行,以朋友为列构建访问控制矩阵,填入allow/deny标签。对于每一个朋友抽取出若干属性特征,例如所属的“圈子”,性别,生日,城市等信息,可实现对朋友的向量化表示。基于已有的部分朋友和用户打上的访问许可的标签生成训练样本,其他朋友以及用户新添加的朋友作为测试样本。对于每一项用户资料,例如用户生日信息,系统让用户对少量朋友按照自己的意愿打上allow/deny标签,然后系统基于这些输入形成的训练样本,利用机器学习算法构建分类器,就可以使用该分类器来自动对剩余朋友及用户新添加的朋友设置对该资料的allow/deny访问权限。 现有研究表明[CCS10’ WWW10’],真实的SNS用户会更多基于不同的“圈子”来考虑他们的隐私偏好,而“圈子”信息很容易利用现有技术从社交网络图谱中抽取出来。使用朋友所属的“圈子”信息,可以自动计算出很高准确度的用户隐私保护推荐策略,而需要的用户输入比照当前的SNS隐私保护机制少很多。

2012-06-03

基于Apriori、FP-Growth及Eclat算法的频繁模式挖掘源程序

基于Apriori、FP-Growth及Eclat算法的频繁模式挖掘源程序 一、DataMiningApriori程序 用eclipse打开,把三个测试数据mushroom、accidents和T10I4D100K放置 在F:\DataMiningSample\FPmining文件夹下面,即可运行 二、FP-growth程序 1、包括程序源文件和编译生成的可执行原件 2、程序运行方法 把FP_Growth.exe可执行文件与三个测试数据mushroom、accidents 和T10I4D100K放置在同一个文件夹下面,双击FP_Growth.exe,即可 顺序挖掘mushroom、accidents和T10I4D100K事物数据集中的频繁 模式,阈值设定见testfpgrowth.cpp文件中的main函数 三、Eclat程序直接用eclipse打开执行 四、输出的频繁模式及支持度文件示例给出了部分输出文件,由于全部输出文件太大,所有没有全部给出,可以由执行程序得出。另外附带详解PPT

2012-04-24

基于Apriori、FP-Growth及Eclat算法的频繁模式挖掘源程序共享版

基于Apriori、FP-Growth及Eclat算法的频繁模式挖掘源程序共享版 一、DataMiningApriori程序 用eclipse打开,把三个测试数据mushroom、accidents和T10I4D100K放置 在F:\DataMiningSample\FPmining文件夹下面,即可运行 二、FP-growth程序 1、包括程序源文件和编译生成的可执行原件 2、程序运行方法 把FP_Growth.exe可执行文件与三个测试数据mushroom、accidents 和T10I4D100K放置在同一个文件夹下面,双击FP_Growth.exe,即可 顺序挖掘mushroom、accidents和T10I4D100K事物数据集中的频繁 模式,阈值设定见testfpgrowth.cpp文件中的main函数 三、Eclat程序直接用eclipse打开执行 四、输出的频繁模式及支持度文件示例给出了部分输出文件,由于全部输出文件太大,所有没有全部给出,可以由执行程序得出。另外附带详解PPT

2012-04-24

基于Kmeans算法、MBSAS算法及DBSCAN算法的newsgroup18828文本聚类器

基于Kmeans算法、MBSAS算法及DBSCAN算法的newsgroup18828文本聚类器 程序运行方法:用eclipse打开工程,并将newsgroup文档集解压到 F:\DataMiningSample\orginSample目录下,同时在F:\DataMiningSample\ 下建好如附件“F盘DataMiningSample目录下的数据子目录结构”图中的目录, 停用词表也放在"F:/DataMiningSample/目录下,即可运行eclipse工程。 本project源代码一共三个工程文件 DataMiningCluster-Kmeans算法及SVD分解降维代码 MBSAS-MBSAS算法代码 DBSCAN-DBSCAN算法代码 结果文件:Kmeans_result MBSAS_result

2012-04-17

基于贝叶斯及KNN算法的newsgroup文本分类器免积分下载版

基于贝叶斯及KNN算法的newsgroup文本分类器,eclipse工程,免积分下载版 程序运行方法:用eclipse打开工程,并将newsgroup文档集解压到 F:\DataMiningSample\orginSample目录下,同时在F:\DataMiningSample\ 下建好如附件“F盘DataMiningSample目录下的数据子目录结构”图中的目录, 停用词表也放在"F:/DataMiningSample/目录下,即可运行eclipse工程。程序 会依次执行数据预处理、贝叶斯分类、KNN分类,输出10次交叉验证实验的分类 结果、准确率统计及混淆矩阵。

2012-03-31

基于贝叶斯及KNN算法的newsgroup文本分类器

基于贝叶斯及KNN算法的newsgroup文本分类器,eclipse工程 程序运行方法:用eclipse打开工程,并将newsgroup文档集解压到 F:\DataMiningSample\orginSample目录下,同时在F:\DataMiningSample\ 下建好如附件“F盘DataMiningSample目录下的数据子目录结构”图中的目录, 停用词表也放在"F:/DataMiningSample/目录下,即可运行eclipse工程。程序 会依次执行数据预处理、贝叶斯分类、KNN分类,输出10次交叉验证实验的分类 结果、准确率统计及混淆矩阵。

2012-03-27

基于tesseract的多线程OCR服务器的JAVA实现

基于tesseract的多线程OCR服务器的JAVA实现 Eclipse工程 可以运行

2012-03-07

数据挖掘决策树ID3算法C++实现

数据挖掘决策树ID3算法C++实现 数据挖掘入门程序

2012-03-07

数据挖掘candidate_elimination算法实现

数据挖掘candidate_elimination算法实现 采用C++实现 学习数据挖掘入门程序

2012-03-07

arm 嵌入式系统经典学习课件

arm 嵌入式系统经典学习课件,学习嵌入式必备课件,大家可以下载学习

2009-09-27

JAVA WEB 选课系统源代码

选课系统源代码,用java实现,学Java web 编程入门必备 大家可以下载学习

2009-09-27

ARM9嵌入式技术及嵌入式Linux高级实验教程

ARM9嵌入式技术及嵌入式Linux高级实验教程

2009-07-07

空空如也

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

TA关注的人

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