自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(14)
  • 资源 (2)
  • 收藏
  • 关注

转载 隐马尔可夫模型 (Hidden Markov Model,HMM)

隐马尔可夫模型 (Hidden Markov Model,HMM) 最初由 L. E. Baum 和其它一些学者发表在一系列的统计学论文中,随后在语言识别,自然语言处理以及生物信息等领域体现了很大的价值。平时,经常能接触到涉及 HMM 的相关文章,一直没有仔细研究过,都是蜻蜓点水,因此,想花一点时间梳理下,加深理解,在此特别感谢 52nlp 对 HMM 的详细介绍。   考虑下面交通灯的例子

2014-11-10 09:39:54 826

转载 计算几何算法概览——位置关系

一。位置关系: 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 779

原创 归并排序

/**归并**/ #define N 10 #include #include using 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 439

原创 简单选择排序

/**简单选择**/ #define N 10 #include using 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 398

原创 直接插入排序

/**直接插入**/ #include #define N 10 using 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 386

原创 冒泡排序

#define N 10 #include using 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 413

原创 希尔排序

/***希尔排序****/ #define N 11 #include using 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 433

原创 快速排序

/***快速排序***/ #include #define N 11 using 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 467

原创 基数排序

/*****基数排序******/ #define N 10 #define RADIX 10 #include using 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 461

原创 堆排序

#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 402

原创 折半插入排序

#define N 11 #include using 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 446

原创 基于邻接表的图的深度和广度优先搜索遍历

/*****头文件Graph.h**********/ #define MAX_VERTEX 20 #define GQSIZE 20 #include using namespace std; typedef char VertexType; //各个结构体的定义 typedef struct ANode{ int AdjVex; struct ANode *NextArc; }Ar

2014-04-29 11:04:13 1027

转载 const在函数前与函数后的区别

一   const基础           如果const关键字不涉及到指针,我们很好理解,下面是涉及到指针的情况:           int   b   =   500;      const   int*   a   =   &b;              [1]      int   const   *a   =   &b;              [2]      in

2014-04-28 11:04:03 407

原创 二叉树上的各种操作

#define MAXQSIZE 50 #include #include #include using namespace std; typedef char ElemType; typedef struct Node{  ElemType data;  struct Node *lchild, *rchild; }BiTNode, *BiTree; typedef stru

2014-04-25 22:39:47 711

九种经典排序算法的实现

含有折半插入、交换冒泡、堆排序、直接插入、归并排序、快速排序、基数排序、简单选择、希尔排序等的算法实现

2014-05-03

希尔插入排序

1、此代码由C++实现 2、分别含有各趟的排序情况

2014-04-26

空空如也

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

TA关注的人

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