- 博客(4)
- 收藏
- 关注
转载 字典树
PS:本人蒟蒻,欢迎大家指正错误 一,字典树(Trie-Tree) 定义:又名单词查找树,为树状结构,是哈希树的变种。利用字符串的公共前缀,在存储时节约空间,查询时节约时间,尽可能减少不必要的字符比较。 二,功能 1. 利用公共前缀存储大量字符串 2. 减少查找字符串时的比较 3. 查询一个字串s在字典中总共出现的次数 三,代码实现 利...
2019-01-23 16:52:00 58
转载 最小生成树
PS:参考某算法书籍,写了这篇学习笔记 一.生成树(SpanningTree)及最小生成树(MST) 定义:给定无向图,若它的某个子图任意两个顶点都互相连通且为一棵树,那么这棵树成为生成树,如果边上有权值,那么可以使边权值和最小的生成树称为最小生成树。 二.相关算法 1.Prim算法 算法描述:假设有一棵只包含一个顶点v的树T,贪心地选取T和其他顶点相连的最小权值的边,将其加入...
2019-01-19 11:34:00 38
转载 LeetCode 931. Minimum Falling Path Sum
Given a square array of integers A, we want the minimum sum of a falling path through A. A falling path starts at any element in the first row, and chooses one element from each row. The next...
2019-01-19 08:57:00 43
转载 LeetCode 785. Is Graph Bipartite?
Given an undirected graph, return true if and only if it is bipartite. Recall that a graph is bipartite if we can split it's set of nodes into two independent subsets A and B such that every e...
2019-01-19 08:37:00 49
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人