线段树

所属分类:数据结构
开发工具:C/C++
文件大小:93KB
下载次数:0
上传日期:2021-04-28 16:19:58
上 传 者melan.YY
说明:  线段树是一种二叉搜索树,与区间树相似,它将一个区间划分成一些单元区间,每个单元区间对应线段树中的一个叶结点。 使用线段树可以快速的查找某一个节点在若干条线段中出现的次数,时间复杂度为O(logN)。而未优化的空间复杂度为2N,实际应用时一般还要开4N的数组以免越界,因此有时需要离散化让空间压缩。
(Line segment tree is a kind of binary search tree, similar to interval tree. It divides an interval into some unit intervals, and each unit interval corresponds to a leaf node in the line segment tree. Using segment tree can quickly find the number of times a node appears in several segments, and the time complexity is O (logn). However, the space complexity of the unoptimized one is 2n. In practical application, it is necessary to open an array of 4N to avoid crossing the boundary. Therefore, discretization is sometimes needed to compress the space.)

文件列表:
线段树.pdf (101791, 2021-04-26)

近期下载者

相关文件


收藏者