随笔分类 - Algorithm
摘要:https://www.jiuzhang.com/solution/implement-trie/ 算法:字典树 思路: 题目要求实现一个Trie,包含插入、查找和查找前缀三个方法。 Trie树也称字典树,因为其效率很高,所以在在字符串查找、前缀匹配等中应用很广泛,其高效率是以空间为代价的。 原理:
阅读全文
摘要:https://www.bigocheatsheet.com/ Know Thy Complexities! Hi there! This webpage covers the space and time Big-O complexities of common algorithms used i
阅读全文
摘要:https://www.cnblogs.com/gj-Acit/archive/2013/05/06/3062628.html 哈希函数的构造方法 哈希函数的构造方法 本文阐述了哈希函数的构造方法有很多,但应注意两个原则:第一,函数值应在1至记录总数之间;第二,尽可能避免冲突。 设要存放的数据元素有
阅读全文
摘要:https://www.tutorialspoint.com/degree-of-vertex-of-a-graph It is the number of vertices adjacent to a vertex V. Notation − deg(V). In a simple graph w
阅读全文
摘要:算法基础:BFS和DFS的直观解释 https://cuijiahua.com/blog/2018/01/alogrithm_10.html 一、前言 我们首次接触 BFS 和 DFS 时,应该是在数据结构课上讲的 “图的遍历”。还有就是刷题的时候,遍历二叉树我们会经常用到BFS和DFS。它们的实现
阅读全文