- 博客(20)
- 资源 (9)
- 问答 (1)
- 收藏
- 关注
原创 贝叶斯分类器(一)
贝叶斯推理提供了一种概率(主要应用条件概率)学习手段,根据以往数据的概率分布和已观察到的数据进行推理判断。对数据量大的问题十分适用,在云计算和大数据时代再次成为研究热点。贝叶斯分类器分成两个部分,第一部分对基础知识、贝叶斯决策论、极大似然估计、朴素贝叶斯分类器和半朴素贝叶斯分类器进行介绍,第二部分对贝叶斯网进行详细介绍。
2016-08-04 15:50:35
22779
1
原创 排序算法实现以及比较
本文介绍了常用的内排序算法包括比较排序算法(插入排序、冒泡排序、选择排序、快速排序、归并排序、堆排序)和基于运算的排序算法(基数排序、桶排序)。分别对这些算法从算法思想、伪代码、复杂度和稳定性、算法的Java实现几个方面进行了简单的介绍。
2016-07-31 19:33:28
2387
原创 字符串匹配
最近看了一下字符串匹配的知识,在这里总结一下。在算法导论中作者给出了四种字符串匹配算法,这里给出两种最常用的字符串匹配算法:朴素字符串匹配算法和KMP算法
2016-02-21 17:00:51
487
原创 最优决策和最满意决策问题
苏格拉底弟子摘麦穗问题 古希腊哲学大师苏格拉底的三个弟子求教老师:怎样才能获得成功?苏格拉底没有直接回答,让他们去麦田,只许往前走,且仅有一次机会,要求是:选摘一个最好最大的麦穗。第一个弟子没走几步就看见一个又大又漂亮的麦穗,高兴地摘下来继续往前走,发现前面还有好多更好的,但是自己的一次机会已经用过了,只得遗憾的走完全程;第二个弟子整好相反,每当摘时,总是自我提醒,后面有更
2016-01-10 16:28:41
6555
原创 LeetCode(9)--Palindrome Number
题目如下: Determine whether an integer is a palindrome. Do this without extra space.解题解题思路: 该问题最大的难道在于无额外的空间,如果没有此限制,可以将数字转换成String然后对String反转比较两个字符串是否相等就可以了,但是,既然有了此限制,就得去想其他方法了。先借用一个中间变量判断该数字的长度,然后根据数的
2015-12-03 22:06:13
329
原创 LeetCode(8)--String to Integer (atoi)
题目如下: Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible inpu
2015-12-03 21:58:59
364
原创 LeetCode(7) -- Reverse Integer
题目如下: Reverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321解题思路: 将x从各位逐个往后取,然后依次放到y的变量中,一个简单的代码实现如提交的代码。该问题需要考虑的问题,对于反转的数不能溢出。 提交的代码: public int reverse(int
2015-12-03 21:48:30
354
原创 LeetCode(6)--ZigZag Conversion
题目如下: The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A P L
2015-12-01 16:18:40
341
原创 LeetCode(5)--Longest Palindromic Substring
题目如下: Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.解题思路: 本题与判断回文还有一些区别
2015-12-01 11:25:37
359
原创 LeetCode(125)--Valid Palindrome
题目如下: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example, “A man, a plan, a canal: Panama” is a palindrome. “race a car” is not
2015-12-01 10:48:59
381
原创 LeetCode(4)--Median of Two Sorted Arrays
题目如下: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).解题思路: 思路1:最直接的一种思路就是将两
2015-11-30 14:17:41
270
原创 LeetCode(3)--Longest Substring Without Repeating Characters
题目如下: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for “abcabcbb” is “abc”, which the length is 3
2015-11-29 21:54:08
446
原创 LeetCode(2)--Add Two Numbers
题目如下: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as
2015-11-29 21:23:27
330
原创 LeetCode(1)--Two Sum
题目如下: Given an array of integers, find two numbers such that they add up to a specific target number.
2015-11-29 21:09:33
322
原创 iPhone5s 换电池、修右上角翘起的悲催过程
下面是电池的参数: 最近发现手机电池续航能力越来越差,并且右上角有点翘屏,所以,准备对手机进行大修,在网上购买了电池和玻璃胶(用来粘屏幕)。在网上看的最好用玻璃胶,然后,我就在网上找玻璃胶,最后,悲催的是哥想买的是小拇指这么大滴,收到货以后却是胳膊这么粗的,,其实想退货,但想了想还是试试行不行吧,胶说不准以后也有用。 拆机的时候,不小心扯了一下,home的排线(最悲催的从这
2015-11-27 10:06:47
9096
原创 Spark初体验(2)--WordCount详解
WordCount代码如下:import org.apache.spark.{SparkContext, SparkConf}/** * Created by zhangph on 2015/11/25. */object WordCount { def main (args: Array[String]) { if(args.length < 1){ System.er
2015-11-25 20:37:42
414
原创 Spark框架
Spark的整体流程为:Client提交应用,Master找到一个Worker启动Driver,Driver向Master或者资源管理器申请资源,之后将应用转化为RDD Graph,再由DAGScheduler将RDD Graph转化为Stage的有向无环图提交给TaskScheduler,由TaskScheduler提交任务给Executor执行。在任务执行的过程中,其他组件协同工作,确保整个应
2015-11-24 21:31:50
916
原创 初识Hadoop——Hadoop-1.2.1和Hadoop-2.7.1的配置以及常见问题分析
最近在研究Hadoop-1.X的源码,在安装Hadoop-1.2.1的时候遇到了很多的问题,待配置好了1.X之后索性也搭建一下2.X的环境吧,结果遇到了更多的麻烦~下面就Hadoop学习过程中遇到的问题来与大家分享,同时,也希望技术大牛能给出更好的解决方案。OpenJDK Server VM warning: Insufficient space for shared me
2015-08-29 16:02:26
332
K-NNT问题的实现的时候遇到了麻烦,请大神帮忙
2015-04-29
TA创建的收藏夹 TA关注的收藏夹
TA关注的人