Algorithm
Digital2Slave
图像处理算法,机器学习,深度学习及其应用。
展开
-
字符串匹配的KMP算法
转载自:点击打开链接转载 2014-11-24 14:55:25 · 723 阅读 · 0 评论 -
C++ 单链表创建、插入和删除
#include #include #include #include /*** cstdio是将stdio.h的内容用C++头文件的形式表示出来。*stdio.h是C标准函数库中的头文件,即:standard buffered input&output。*提供基本的文字的输入输出流操作(包括屏幕和文件等)。原创 2014-04-01 10:23:10 · 33078 阅读 · 6 评论 -
单链表排序和逆置
#include #include #include #include /*** cstdio是将stdio.h的内容用C++头文件的形式表示出来。*stdio.h是C标准函数库中的头文件,即:standard buffered input&output。*提供基本的文字的输入输出流操作(包括屏幕和文件等)。原创 2014-04-02 10:58:20 · 1289 阅读 · 0 评论 -
双链表的创建、测长、打印、插入和删除
内容RT,实现代码如下所示:#include #include #include using namespace std;typedef struct student{ int data; struct student *next; struct student *pre;}dnode;// 建立双链表dnode *creat(){ dnode *head, *原创 2014-04-03 16:23:07 · 1170 阅读 · 0 评论 -
C++ 大数阶乘求取--数组实现代码
http://hi.baidu.com/urzalknsyzchrur/item/3934e84e821b7de31381da8d转载 2014-04-14 21:13:52 · 3318 阅读 · 0 评论 -
排序算法之--冒泡排序
冒泡排序的C++实现代码如下所示:// Sort.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include using namespace std;template void Bubble(T Array[], T length){ if (Array == NULL || length < 0) { r原创 2014-04-21 11:25:47 · 1008 阅读 · 0 评论 -
排序算法之--快速排序
快速排序算法是C.R.A.Hoare 在1962年提出的一种采用分治策略(分治法--Divide and Conquer Method)的划分交换排序算法。分治法的基本思想是将原问题分解为若干个规模更小,但结构和原问题相似的子问题;递归地解决这些子问题。快速排序的基本思想是:首先,在待排序数组Array中任选一个值作为基准Base;然后,以Base将当前待排序数组划分为左右两个原创 2014-04-22 21:42:23 · 804 阅读 · 0 评论 -
LeetCodeOJ--002(C++ && Python)
Median of Two Sorted ArraysThere are two sorted arrays A and B 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)).原创 2014-06-05 19:15:34 · 934 阅读 · 0 评论 -
时间复杂度、空间复杂度
时间复杂度、空间复杂度算法复杂度分为时间复杂度和空间复杂度。其作用:时间复杂度是指执行算法所需要的计算工作量;而空间复杂度是指执行这个算法所需要的内存空间。一、时间复杂度时间频度一个算法执行所耗费的时间,从理论上是不能算出来的,必须上机运行测试才能知道。但我们不可能也没有必要对每个算法都上机测试,只需知道哪个算法花费的时间多,哪个算法花费的时间少就可以了。并且一个算转载 2014-04-10 18:09:42 · 835 阅读 · 0 评论 -
进程管理
*☆☆☆☆☆* 1.在进程管理中,当 等待的事件发生 时进程从阻塞状态变为就绪状态. 2.分配到必要的资源并获得处理机时的进程状态是 执行状态 。 3.P、V操作是 两条低级进程通信原语 。 4.对进程的管理和控制使用 原语 。 5.进程的并发执行是指若干个进程 在执行的时间上是重叠的 。 6.若P、V操作的信号量S初值为2,当前值为-1,则表示原创 2015-03-07 10:25:18 · 4486 阅读 · 0 评论 -
算法工程师--图像相关
算法工程师(图像方向)图像处理下列算法中属于图像锐化处理的是高通滤波。图像编码的目的是压缩数据、减少图像存储空间、提高图像传输效率。(个人理解)图像边缘检测算子有Sobel算子、Roberts算子、Prewitt算子、Laplacian算子和Canny算子。下列算法中,属于点处理的是傅里叶变换。 a. 二值化 b. 梯度锐化 c.中值滤波 d.傅里叶变换下列压缩编码方式中,有损压缩是DC原创 2016-06-04 18:22:06 · 2369 阅读 · 0 评论 -
Mathematics
1 WIFI密码∫5−5x3sin2xx4+2x2+1dx\int_{-5}^{5} \frac{x^3sin^2x}{x^4+2x^2+1}dx \qquad方法一因为 x∈[−5,5]x\in[-5, 5] 对称区间内,同时, 令 f(x)=x3sin2xx4+2x2+1f(x)=\frac{x^3sin^2x}{x^4+2x^2+1} f(−x)=−f(x)f(-x)=-f(x)所以,∫5原创 2017-01-14 10:50:22 · 3233 阅读 · 0 评论 -
DL-1: Tips for Training Deep Neural Network
Different approaches for different problems.e.g. dropout for good results on testing data.Choosing proper lossSquare Error∑i=1n(yi−yiˆ)2\sum_{i=1}^{n}(y_i-\widehat{y_i})^2 \qquadCross Entropy −∑i=1原创 2017-03-22 17:09:29 · 1382 阅读 · 0 评论 -
DL-2: Variants of Neural Network
本文主要参考台湾大学李宏毅(Hung-yi Lee)的深度学习教程PPT文档。CNN(Convolutional Neural Network) widely used in image processing.RNN(Recurrent Neural Network) Neural Network with Memory.CNNA neuron does not have to see the原创 2017-03-22 17:20:20 · 1305 阅读 · 4 评论 -
Face detect by Python2 OpenCV2.4.13
Codeimport cv2import syscascPath = sys.argv[1]faceCascade = cv2.CascadeClassifier(cascPath)video_capture = cv2.VideoCapture(0)while True: # Capture frame-by-frame ret, frame = video_capture.r原创 2017-03-22 17:00:32 · 1453 阅读 · 0 评论 -
数字和字符串之间的转换
1.数字到字符串// charint.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include int _tmain(int argc, _TCHAR* argv[]){ int num = 12345; int j = 0, i = 0; printf("intnum = %d\n", num); c原创 2014-04-25 21:11:20 · 1113 阅读 · 0 评论 -
《剑指offer》学习之--反转链表与合并两个排序链表
ListNode* ReverseList(ListNode* pHead){ ListNode* pReversedHead = NULL; //!<翻转链表的头结点为NULL ListNode* pNode = pHead; ListNode* pPrev = NULL; while(pNode != NULL) { List原创 2014-05-19 14:18:09 · 1005 阅读 · 0 评论 -
《剑指offer》学习之--二叉树
18树的子结构输入两棵二叉树A和B,判断B是不是A的子结构。er原创 2014-05-19 15:05:41 · 767 阅读 · 0 评论 -
分层遍历二叉树
#include #include #include #include #include #include using namespace std;struct Node{ int data; // 节点中的数据 Node *m_pLeft; Node *m_pRight;};Node* CreatNode(int value){ Node* pNod原创 2014-10-11 08:52:13 · 911 阅读 · 1 评论 -
字符串循环移位包含问题
#include #include #include #include using namespace std;void PrintCharArray(string a);bool CharContain(string src, string des);int main(int argc, char *argv[]){ /* * 字符串的移位包含问题:给定两个字符串s1原创 2014-10-10 10:27:44 · 1471 阅读 · 0 评论 -
1~9数字问题
/**1~9的9个数字,每个数字只能出现一次,要求这样一个9位整数:其第一位能被1整除,前两位能被2整除,*前三位能被3整除...依次类推,前9位能被9整除。*///方法1 ---> 381654729#include#include#include bool Used[10];vector v;void Dfs(int k, long long val){ if (k原创 2014-09-15 15:31:25 · 3120 阅读 · 0 评论 -
LeetcodeOJ--整理
// 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 searc原创 2014-06-17 20:16:38 · 1073 阅读 · 0 评论 -
LeetCodeOJ--Remove Duplicates from Sorted Array(c++ && python版本)
Remove Duplicates from Sorted Array 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 ano原创 2014-06-14 14:31:38 · 1007 阅读 · 0 评论 -
LeetCodeOJ--Reverse Words in a String(python版本)
Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".click to show clarification.Clarification:What constitutes原创 2014-06-09 11:09:44 · 2108 阅读 · 0 评论 -
LeetCodeOJ--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".click to show clarification.Clarification:What constitutes转载 2014-06-05 19:24:47 · 1181 阅读 · 0 评论 -
LeetCodeOJ--001(C++ && Python)
Two SumGiven 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原创 2014-06-05 19:11:48 · 913 阅读 · 0 评论 -
排序算法收集整理
1.http://blog.chinaunix.net/uid-25063573-id-3042159.html原创 2014-06-04 22:00:56 · 851 阅读 · 0 评论 -
逆波兰表达式
以前写过计算一个字符串的表达式,当时都不知道有逆波兰这东西,- -!真是孤陋寡闻了,不过勉强用其他方法写了出来,用到了递归,不过整体来说很罗索!逆波兰对这种字符串的表达式计算很容易,只要把一个普通的表达式转换成逆波兰后计算就轻松很多!首先看一下普通表达式:(1+2)*(2-1) 转成逆波兰后变成 1 2 + 2 1 - *下面说说怎么转成逆波兰,然后再说计算逆波兰!转载 2014-06-02 09:09:13 · 1222 阅读 · 0 评论 -
排序算法之----快速排序算法
// 《剑指Offer——名企面试官精讲典型编程题》代码// 著作权所有者:何海涛#include "stdafx.h"#include #include "Array.h"#include // Random Partitionint RandomInRange(int min, int max){ int random = rand() % (max - min +转载 2014-05-31 10:29:50 · 888 阅读 · 0 评论 -
《剑指offer》二叉树的遍历
面试题23:从上往下打印二叉树(同一层)原创 2014-05-29 09:51:30 · 826 阅读 · 0 评论 -
《程序员面试宝典》之螺旋队列问题学习
1.由内向外螺旋队列查找指定位置数值问题。原创 2014-05-19 19:45:15 · 1796 阅读 · 0 评论 -
《剑指offer》学习之--顺时针打印矩阵
#include "stdafx.h"void PrintMatrixInCircle(int** numbers, int columns, int rows, int start);void printNumber(int number);void PrintMatrixClockwisely(int** numbers, int columns, int rows){ i原创 2014-05-19 18:49:59 · 1080 阅读 · 0 评论 -
查找数字字符串中每个数字出现的次数
最近几天在review之前同学写的图像处理代码,发现里面数字字符串中每个数字出现次数的计算过程写的有些许冗余之处。因此,我就按照自己理解的重新写了一份。问题计算数字字符串中每个数字字符出现的次数。例如: 输入: 123344668 输出:1 --> 12 --> 13 --> 24 --> 26 --> 28 --> 1实现代码本文我使用Python语言实现计算字符出现次数的过程,其他原创 2017-05-02 16:23:03 · 2715 阅读 · 0 评论