随笔分类 - 数据结构
数据结构就应该有数据结构的亚子
摘要:链表版字典树 class Trie { Trie* next[26]; int num; public: Trie() { for (int i = 0; i < 26; ++i) next[i] = NULL; num = 0; } void insert(char *s) { Trie *p =
阅读全文
摘要:并查集(Disjoint Set Union)模板 #include <vector> using namespace std; /** * Disjoint Set Union */ class DSU { vector<int> s; int cnt; // 记录集合个数 public: DSU
阅读全文

浙公网安备 33010602011771号