07 2019 档案
摘要:以前看人利用口诀记忆排序的稳定性:考研好痛苦,一堆(堆排序)专业课,情绪不稳定(不稳定排序),快(快速排序)来选(选择排序)一些(希尔排序)朋友聊聊天吧,剩下的都是稳定的。 感觉不错。。。。。。 接下来是八大排序总结 : (1)冒泡排序 冒泡排序就是把小的元素往前调或者把大的元素往后调。比较是相邻的
阅读全文
摘要:返回类型为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]
阅读全文
摘要: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
阅读全文
摘要:#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)); ...
阅读全文