12 2020 档案

摘要:简单排序 冒泡排序 冒泡排序,类似于水中冒泡,较大的数沉下去,较小的数慢慢冒起来,假设从小到大,即为较大的数慢慢往后排,较小的数慢慢往前排。 直观表达,每一趟遍历,将一个最大的数移到序列末尾。 void bubbleSort(int* array, int len) { for (int n = 0 阅读全文
posted @ 2020-12-20 16:44 如果的事 阅读(155) 评论(0) 推荐(0)
摘要:C++ Singleton Lazy Singleton C++11的一个Lazy Singleton(懒汉)版本: class Singleton { public: Singleton(const Singleton&) = delete; Singleton& operator=(const 阅读全文
posted @ 2020-12-01 12:33 如果的事 阅读(1394) 评论(0) 推荐(0)