#include <iostream> using namespace std; constexpr int MEMORYPOOL_ALIGNMENT = 8; //对齐长度 // 内存块 template<typename _T> struct MemoryBlock { int nSize; / Read More
posted @ 2020-01-11 23:27 鸿钧三清 Views(502) Comments(0) Diggs(0) Edit
简单测试发现3最快1最慢 Read More
posted @ 2019-07-27 12:19 鸿钧三清 Views(345) Comments(0) Diggs(0) Edit
以前看人利用口诀记忆排序的稳定性:考研好痛苦,一堆(堆排序)专业课,情绪不稳定(不稳定排序),快(快速排序)来选(选择排序)一些(希尔排序)朋友聊聊天吧,剩下的都是稳定的。 感觉不错。。。。。。 接下来是八大排序总结 : (1)冒泡排序 冒泡排序就是把小的元素往前调或者把大的元素往后调。比较是相邻的 Read More
posted @ 2019-07-20 13:54 鸿钧三清 Views(1334) Comments(0) Diggs(0) Edit
返回类型为bool: 1 template<class T> static bool binarySearch(T *s, T const &e, int lo, int hi){ 2 while (lo < hi) { 3 int mi = (lo + hi) >> 1; 4 e < s[mi] Read More
posted @ 2019-07-18 19:26 鸿钧三清 Views(172) Comments(0) Diggs(0) Edit
1 #include <ctime> 2 #include <iostream> 3 #include <algorithm> 4 5 using namespace std; 6 7 class family{ 8 public: 9 family(int cnt = 10000) :cnt(cn Read More
posted @ 2019-07-13 09:18 鸿钧三清 Views(729) Comments(0) Diggs(0) Edit
#include #include #include using namespace std; class birthday{ public: birthday(int n = 10000, int m = 50) : n(n), m(m){ } void test(){ srand((unsigned)time(nullptr)); ... Read More
posted @ 2019-07-13 09:08 鸿钧三清 Views(648) Comments(0) Diggs(0) Edit