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

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

转载 几句话弄清楚Java参数传值还是传引用

最近刷题用递归解决关于树的问题的时候,在递归函数调用的时候什么时候传入值,什么时候传入引用有疑问,因为这关系到什么时候我们需要恢复现场,什么时候不需要。在网上搜索了一下,感觉这篇总结的非常简单明了,简而言之,基础数据类型(int,char,……)传值,对象类型(Object,数组,容器……)传引用。但是对于String, Integer, Double等等immutable的类型,也是传值需要特殊

2015-01-28 14:58:10 19876 3

原创 LeetCode Path Sum II

Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree and sum = 22, 5 / \

2015-01-28 14:44:23 2137 2

原创 LeetCode Path Sum

Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Given the below binary tree and sum = 22

2015-01-28 13:46:02 1496 1

原创 LeetCode Construct Binary Tree from Preorder and Inorder Traversal

Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.思路分析:这题类似于LeetCode Construct Binary Tree from Inorder and Postord

2015-01-28 12:30:19 2099 1

原创 LeetCode Construct Binary Tree from Inorder and Postorder Traversal

Given inorder and postorder traversal of a tree, construct the binary tree.思路分析:这题主要考察递归,我们可以画一个二叉树的实例来具体分析。比如如果postorder 是84526731,inorder是84521637,首先我们可以知道postorder的最后一个数1必然是root,然后我们可以在inorder里面找到这

2015-01-28 12:24:49 2173 1

原创 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 1636

原创 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 1887

原创 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 2128 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 1752

原创 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 1928

原创 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 2508

原创 面试题:如何在一千万个不重复整数(电话号码)中查找某个特定数 位运算 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 5849 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 1319

原创 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 1720

原创 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 1264

原创 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 1531

原创 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 1807

原创 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 3115

原创 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 3587

原创 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 1583

原创 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 1546

原创 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 2909

原创 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 1629

原创 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 1884 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 3893

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关注的人

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