About 12,500,000 results
Open links in new tab
  1. algorithm - What are the differences between segment trees, interval ...

    Jul 4, 2013 · What are differences between segment trees, interval trees, binary indexed trees and range trees in terms of: Key idea/definition Applications Performance/order in higher …

  2. algorithm - Is it possible to query number of distinct integers in a ...

    Sep 30, 2016 · This is done with a segment-tree-like structure which is sometimes called Merge Sort Tree. It is basically a segment tree where each node stores a sorted subarray. This structure …

  3. Segment tree - query complexity - Stack Overflow

    Jan 17, 2017 · A range query using a segment tree basically involves recursing from the root node. You can think of the entire recursion process as a traversal on the segment tree: any time a recursion is …

  4. algorithm - Fenwick tree vs Segment tree - Stack Overflow

    Oct 4, 2020 · I needed to compute sums within a range on an array, so I came across Segment Tree and Fenwick Tree and I noticed that both of these trees query and update with the same asymptotic …

  5. Segment tree time complexity analysis - Stack Overflow

    Nov 28, 2014 · 1 If we prove that there at most N nodes to visit on each level and knowing that Binary segment tree has max logN height - we can say that query operatioin has is O (LogN) complexity. …

  6. c++ - Segment tree space requirement - Stack Overflow

    Sep 17, 2016 · I have found as explained in this article on HackerEarth that segment trees can be implemented by using arrays where child elements of a node positioned at array-index n are at …

  7. How to implement segment trees with lazy propagation?

    I have searched on internet about implementation of Segment trees but found nothing when it came to lazy propagation. There were some previous questions on stack overflow but they were focused on s...

  8. python - Does a recursive segment tree require more space than an ...

    Jun 23, 2024 · In fact, it is easy to modify the standard recursive segment tree to use 2N instead of 4N nodes. It is common to see an array of 4N nodes allocated because it is simple and doesn't require …

  9. How to build a segment tree using python? - Stack Overflow

    Mar 30, 2018 · would you be able to describe better the goal you are trying to achieve? what exactly is a segment tree? what would be the expected output?

  10. How to update a range in segment tree while maintaining max and min?

    Aug 5, 2012 · I'm implementing segment tree from an array of data, and I also want to maintaining the max/min of the tree while updating a range of data. Here is my initial approach following this tutorial …