算法
singing1001
码农
展开
-
redBlackTree
#include <stdio.h>#include <vector>#include <iostream>using namespace std;enum _CORLOR{ BLACK = 0, RED, MAX_CORLOR};template<class elemType>struct rbNode...原创 2020-02-03 15:40:10 · 140 阅读 · 0 评论 -
avl 树
#include <stdio.h>#include <vector>#include <iostream>using namespace std;template<class elemType>struct avlNode{ avlNode<elemType> *lLink;//left child node...原创 2020-01-30 22:07:12 · 119 阅读 · 0 评论 -
baseNum Sort 基数排序
#include <stdio.h>#include <vector>#include <iostream>using namespace std;using uint = unsigned int ;int baseSort(vector<uint> &A, int start, int end, int bit){...原创 2020-01-28 22:01:11 · 194 阅读 · 0 评论 -
快速排序
#include <stdio.h>#include <vector>#include <iostream>using namespace std;int cnt = 0;int partion(vector<int> &A, int start, int end){ if(end <= start) ...原创 2020-01-27 22:56:20 · 99 阅读 · 0 评论 -
heapSort
#include <stdio.h>#include <vector>#include <iostream>using namespace std;int parentIndex(int i){ return i/2;}int leftChildIndex(int i){ return 2*i;}int rightC...原创 2020-01-27 20:25:43 · 90 阅读 · 0 评论 -
bubble sort
#include <iostream>#include <stdio.h>#include <math.h>#include <string.h>#include <cstdlib>#define NUM_TO_CALC 33int bubbleSort(int *A, int num){ for(int i ...原创 2020-01-11 21:13:05 · 111 阅读 · 0 评论 -
merge Sort
#include <iostream>#include <stdio.h>#include <cstdlib>#include <math.h>#include <string.h>#define NUM_TO_CALC 33//p:start index of A1; q: end index of A1; q+1:s...原创 2020-01-11 20:52:49 · 96 阅读 · 0 评论 -
插入排序
#include <iostream>#include <stdio.h>#include <cstdlib>#include <math.h>#define NUM_TO_CALC 33int insertSort(int *A, int m){ for(int i = 1; i < m; i++) {...原创 2020-01-11 13:55:32 · 68 阅读 · 0 评论