
算法小结
独孤小hi
这个作者很懒,什么都没留下…
展开
-
C++ 基于比较的七种排序
#include <iostream> #include <random> #include <vector> #include <algorithm> using namespace std; void BubbleSort(vector<int> &nums) { int n = nums.size(); for (int i = 0; i < n - 1; i++) { for (int j原创 2021-09-13 19:43:11 · 199 阅读 · 0 评论 -
C++大数运算模板
class BigNum{ public: static vector<int> addTwoVec(vector<int> a, vector<int> b) { int len_a = a.size(); int len_b = b.size(); vector<int> c; reverse(a.begin(), a.end()); reverse(b.begin()原创 2021-01-22 10:33:34 · 171 阅读 · 0 评论 -
C++字典树/Trie树模板总结
一. 基本结构 class Tree { public: bool isWord; vector<Tree*> v; /** Initialize your data structure here. */ Trie() { isWord = false; v.resize(26); //元素个数 全体小写字母26个 } }; 1 需要返回单词string class Tree { public:原创 2021-01-16 13:18:41 · 266 阅读 · 0 评论