How is the memory of the array of segment tree 2 * 2 ^(ceil(log(n))) - 1?

后端 未结 6 585
半阙折子戏
半阙折子戏 2021-01-30 03:21

The link: http://www.geeksforgeeks.org/segment-tree-set-1-sum-of-given-range/. This is the quoted text:

We start with a segment arr[0 . . . n-1]. And ever

6条回答
  •  逝去的感伤
    2021-01-30 04:05

    here are some links .. iterative implementation for building segment tree of size 2*n-1 from array of n(any number) length https://www.geeksforgeeks.org/segment-tree-efficient-implementation/ recursive implementation for building segment tree of size 2*n-1 from array of n(any number) length https://www.hackerearth.com/practice/notes/segment-tree-and-lazy-propagation/#c191521

    iterative implementation for building segment tree of size less than 4*n from array of n(any number) https://codeforces.com/blog/entry/18051

提交回复
热议问题