- 博客(14)
- 资源 (2)
- 收藏
- 关注
转载 隐马尔可夫模型 (Hidden Markov Model,HMM)
隐马尔可夫模型 (Hidden Markov Model,HMM) 最初由 L. E. Baum 和其它一些学者发表在一系列的统计学论文中,随后在语言识别,自然语言处理以及生物信息等领域体现了很大的价值。平时,经常能接触到涉及 HMM 的相关文章,一直没有仔细研究过,都是蜻蜓点水,因此,想花一点时间梳理下,加深理解,在此特别感谢 52nlp 对 HMM 的详细介绍。 考虑下面交通灯的例子
2014-11-10 09:39:54
873
转载 计算几何算法概览——位置关系
一。位置关系:4.折线段的拐向判断: 折线段的拐向判断方法可以直接由矢量叉积的性质推出。对于有公共端点的线段p0p1和p1p2,通过计算(p2 - p0) × (p1 - p0)的符号便可以确定折线段的拐向: 若(p2 - p0) × (p1 - p0) > 0,则p0p1在p1点拐向右侧后得到p1p2。 若(p2 - p0) × (p1 - p0) 若(p2 -
2014-06-10 09:35:04
850
原创 归并排序
/**归并**/#define N 10#include#includeusing namespace std;void Merge(int *a, int *b, int i, int m, int n){ int k = i; int j = m + 1; for (; i <= m&&j <= n; k++) { if (a[i] < a[j])b[k] = a[
2014-05-11 13:12:11
469
原创 简单选择排序
/**简单选择**/#define N 10#includeusing namespace std;void SelectSort(int a[], int len){for (int i = 0; i != len-1; i++){int min = i;for (int j = i+1; j != len; j++){if (a[min] >
2014-05-11 13:08:26
425
原创 直接插入排序
/**直接插入**/#include #define N 10using namespace std;void InsertSort(int a[],size_t len){ for (size_t i = 1; i < len; i++) { int temp = a[i]; for (size_t j = i - 1; j>=0; j--) { if (tem
2014-05-11 13:05:55
410
原创 冒泡排序
#define N 10#includeusing namespace std;void BubbleSort(int a[]){ for (size_t i = 1; i <= 9; i++) { for (size_t j = 9; j >= i; j--) { if (*(a + j) < *(a + j - 1)) { int temp = *(a
2014-05-11 12:59:37
433
原创 希尔排序
/***希尔排序****/#define N 11#includeusing namespace std;void BInsertSort(int a[], int len){ size_t dk; for (dk = len / 2; dk > 0; dk /= 2) { for (size_t i = dk + 1; i != len + 1; i++) {
2014-05-03 22:21:13
461
原创 快速排序
/***快速排序***/#include #define N 11using namespace std;int Partition(int a[], int low, int high){ a[0] = a[low]; while (low<high) { while (low=a[0])--high; a[low] = a[high]; while (low<hi
2014-05-03 22:17:47
496
原创 基数排序
/*****基数排序******/#define N 10#define RADIX 10#includeusing namespace std;int GetDataPos(int Data, int &pos) //得到一个数的pos位置的值{ int temp = 1; for (int i = 0; i < pos - 1; i++) temp *= 10; re
2014-05-03 22:14:24
486
原创 堆排序
#include#include#define N 11using namespace std;void HeapAdjust(int a[], int s, int m){int rc = a[s];for (int j = 2 * s; j a[j])break;a[s] = a[j];s = j;}a[s] = rc;}void HeapSort(int a[],int len){for (
2014-05-03 22:09:31
425
原创 折半插入排序
#define N 11#includeusing namespace std;void BInsertSort(int a[],int len){ for (size_t i = 2; i!=len+1; i++) { a[0] = a[i]; size_t low = 1; size_t high = i - 1; while (low<=high) {
2014-05-03 22:01:29
477
原创 基于邻接表的图的深度和广度优先搜索遍历
/*****头文件Graph.h**********/#define MAX_VERTEX 20#define GQSIZE 20#includeusing namespace std;typedef char VertexType; //各个结构体的定义typedef struct ANode{ int AdjVex; struct ANode *NextArc;}Ar
2014-04-29 11:04:13
1085
转载 const在函数前与函数后的区别
一 const基础 如果const关键字不涉及到指针,我们很好理解,下面是涉及到指针的情况: int b = 500; const int* a = &b; [1] int const *a = &b; [2] in
2014-04-28 11:04:03
441
原创 二叉树上的各种操作
#define MAXQSIZE 50#include#include#includeusing namespace std;typedef char ElemType;typedef struct Node{ ElemType data; struct Node *lchild, *rchild;}BiTNode, *BiTree;typedef stru
2014-04-25 22:39:47
736
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人