原创 順序表的基本操作

#include <iostream> #include <time.h> #include <stdlib.h> using namespace std; typedef int dataType; //定義數據類型 typede

原创 數學空間

0.拓撲空間:X是元素的集合,O是拓撲即規則的集合;拓撲是“弱化”了的距離,這個概念比距離空間更加抽象、更加寬泛。1.距離空間(度量空間)2.線性空間(向量空間或矢量空間):可以有加法和數乘運算(八條規則)且運算封閉的向量集合;3.度量線

原创 隱馬爾科夫--維特比算法代碼

# coding=utf-8 import copy def predict(A, B, pi, V, O): state_num_list = range(len(pi)) # 狀態序列的序號 O = [V.ind

原创 循環鏈表的基本操作

#include <iostream> #include <stdlib.h> #include <Windows.h> #include <time.h> using namespace std; typedef int dataT

原创 單鏈表的基本操作

#include <iostream> #include <stdlib.h> #include <Windows.h> #include <time.h> using namespace std; typedef int dataTy

原创 二叉樹的基本操作

#include <iostream> #include <stdlib.h> using namespace std; #define MAXSIZE_STACK 20 typedef char dataType; typedef

原创 隱馬爾科夫--hmmlearn包(python)

# coding=utf-8 import numpy as np from hmmlearn import hmm states = ["box 1", "box 2", "box3"] n_states = len(states)

原创 歸併排序

#include<iostream> #include<vector> using namespace std; //合併兩個有序表 void MergeArr(vector<int> &vec, int first, int mid,

原创 鏈隊列的基本操作

#include <iostream> #include <stdlib.h> using namespace std; typedef int dataType; //定義鏈隊列結點結構 typedef struct Node{ s

原创 隱馬爾科夫--前向算法代碼

# coding=utf-8 def forward_hmm(A, B, pi, V, O): state_num_list = range(len(pi)) # 狀態序列的序號 time_num_list = ra

原创 基數排序算法

#include<iostream> #include<vector> using namespace std; //計數排序 //計數排序假設每個元素都是在0到max之間的一個整數。 //基數排序的基本思想,對於每個元素x,如果我們

原创 交換排序算法

#include<iostream> #include<vector> using namespace std; //冒泡排序 //每一趟從前往後兩兩比較,最終都會有一個最大的元素冒出來並放在最終的序列位置上,而且它們在同一端連續有序

原创 excel中的字母數字轉化

//小B最近對電子表格產生了濃厚的興趣,她覺得電子表格很神奇,功能遠比她想象的強大。她正在研究的是單元格的座標編號,她發現表格單元一般是按列編號的,第1列編號爲A,第2列爲B,以此類推,第26列爲Z。之後是兩位字符編號的,第27列編號爲A

原创 插入排序算法

#include<iostream> #include<vector> using namespace std; //直接插入法 //從前往後依次將每個元素插入前面已排好序的序列中,插入時從後向前順序查找要插入的位置 //每次比較後都

原创 根據先序和中序重建二叉樹

#include <iostream> #include <stdlib.h> using namespace std; typedef char dataType; typedef struct Node{ Node *lchild