随笔分类 - data_structure
摘要:https://leetcode.cn/problems/g5c51o/solution/chu-xian-pin-lu-zui-gao-de-k-ge-shu-zi-b-a1td/ 28 | 堆和堆排序:为什么说堆排序没有快速排序快? https://time.geekbang.org/colum
阅读全文
摘要:数据元素之间的关系在计算机中放入2种表示方法 顺序映像、非顺序映像 由此得到2中不同的存储结构: 顺序存储结构、链式存储结构 顺序映像的特点:借助元素在存储器中的相对位置来表示数据元素之间的逻辑关系 非顺序映像的特点:借助指示元素存储地址的指针表示数据元素之间的逻辑关系 数据的逻辑结构和物理结构 算
阅读全文
摘要:https://leetcode.cn/problems/QC3q1f/ https://zh.wikipedia.org/wiki/Trie 应用 trie树常用于搜索提示。如当输入一个网址,可以自动搜索出可能的选择。当没有完全匹配的搜索结果,可以返回前缀最相似的可能。[4] 实现方式 trie树
阅读全文
摘要:06 | 链表(上):如何实现LRU缓存淘汰算法?-极客时间 https://time.geekbang.org/column/article/41013 不过,数组和链表的对比,并不能局限于时间复杂度。而且,在实际的软件开发中,不能仅仅利用复杂度分析就决定使用哪个数据结构来存储数据。 数组简单易用
阅读全文
摘要:206. 反转链表 - 力扣(LeetCode) https://leetcode-cn.com/problems/reverse-linked-list/ class Node: def __init__(self, val=None): self.val = val self.next = No
阅读全文
摘要:建造字典树 插入、查找字典树 相似 package trieNode func ToIndex(a byte) int { /* func CharToASCII(a string) int { return int(a[0]) } func ByteToASCII(a byte) int { re
阅读全文
摘要:B-tree - Wikipedia https://en.wikipedia.org/wiki/B-tree B+ tree - Wikipedia https://en.wikipedia.org/wiki/B%2B_tree A B-tree (Bayer & McCreight 1972)
阅读全文
摘要:Data Structures and Algorithms: Red-Black Trees https://www.cs.auckland.ac.nz/software/AlgAnim/red_black.html A rotation is a local operation in a sea
阅读全文
摘要:AVL 比红黑树 更平衡 查多:AVL 增删多:红黑树 https://www.cs.usfca.edu/~galles/visualization/AlgorithmLibrary/RedBlack.js 红黑树的叶子节点: sentinel nodes 哨兵节点平衡二叉搜索树的高度 保证了搜索的
阅读全文
摘要:AVL 依次插入1、2、3, 插入3,1不平衡了,对节点1左旋后平衡。 graph 1((1))-->2L((NIL)) 1((1))-->2((2)) graph 2((2))-->1((1)) 2((2))-->3((3)) 逆序,依次插入, 插入1,3不平衡了,对节点3右旋后平衡。 依次插入9
阅读全文
摘要:1、二叉搜索树:去一个陌生的城市问路到目的地; for each node, all elements in its left subtree are less-or-equal to the node (<=), and all the elements in its right subtree
阅读全文
摘要:http://math.mit.edu/~fox/MAT307-lecture01.pdf w 离散数学/图论应用在数学/CS以外学科的例子? - 知乎https://www.zhihu.com/question/21241355 w https://en.wikipedia.org/wiki/Gr
阅读全文
摘要:递归练习 组合总和 - 组合总和 - 力扣(LeetCode) https://leetcode.cn/problems/combination-sum/solution/zu-he-zong-he-by-leetcode-solution/ func combinationSum(candidat
阅读全文
摘要:Introduction to Algorithms Third Edition The (binary) heap data structure is an array object that we can view as anearly complete binary tree (see Sec
阅读全文
摘要:https://zh.wikipedia.org/wiki/数据结构术语列表 https://en.wikipedia.org/wiki/List_of_data_structures Data types Primitive types Boolean, true or false. Charac
阅读全文
摘要:小结: 1、 借助linkedlist,每次添加元素后,反转,取逆序 Implement Stack using Queues - LeetCodehttps://leetcode.com/problems/implement-stack-using-queues/solution/ Impleme
阅读全文
摘要:GO语言heap剖析及利用heap实现优先级队列 - 随风飘雪012 - 博客园 https://www.cnblogs.com/huxianglin/p/6925119.html 数据结构STL——golang实现优先队列priority_queue - 知乎 https://zhuanlan.z
阅读全文
摘要:High Performance MySQL, Third Edition by Baron Schwartz, Peter Zaitsev, and Vadim Tkachenko http://dev.mysql.com/doc/refman/5.7/en/ https://zh.wikiped
阅读全文