随笔分类 -  数据结构

数据结构就应该有数据结构的亚子
摘要:链表版字典树 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 = 阅读全文
posted @ 2021-03-12 23:50 Zewbie 阅读(69) 评论(0) 推荐(0)
摘要:并查集(Disjoint Set Union)模板 #include <vector> using namespace std; /** * Disjoint Set Union */ class DSU { vector<int> s; int cnt; // 记录集合个数 public: DSU 阅读全文
posted @ 2021-03-01 15:56 Zewbie 阅读(44) 评论(0) 推荐(0)