Talk:Interval tree

message: Can someone please give an algoritm to insert a element into a centered tree? LostBoy256 (talk) 14:59, 11 February 2020 (UTC)
thread_title:  How to insert to centered tree? 

message: The centered interval tree requires O(n^2) storage, worst case, when intervals intersect all nodes. For example: {(1, 10), (17, 29), (31, 38), (30, 40), (15, 24), (0, 50), (-10, 60), (5, 45)}
:As I understand it the centered interval tree has O(n) storage requirements, not O(n^2).  Any given interval is stored in only one node of the tree because all intervals that overlap x_{\textrm{center}} are in that node.  The nodes reachable by S_{\textrm{left}} and S_{\textrm{right}} are those that do not overlap x_{\textrm{center}}.  So, it follows that any single interval appears in only one node. --300Baud (talk) 03:37, 16 March 2021 (UTC)
thread_title:  Complexity 

message: This link, http://www.dgp.toronto.edu/~jstewart/378notes/22intervals/ describes a completely different approach, I think.
: This look like what is what is called Segment Tree here on WP, in reality there is not much of a distinction. Especially since the naive interval tree described in this article is very inefficient.Carewolf (talk) 21:34, 15 October 2012 (UTC)
thread_title:  Different algorithms 

message: I don't think the interval tree example [] is correct. Each node in the interval tree should contain the maximum of all the interval highs of all of its children nodes. The code shown will simply put the high point of the interval in each node, and not update the maximum values in all of its ancestor nodes.  —Preceding unsigned comment added by 68.165.106.2 (talk) 18:18, 25 September 2008 (UTC)
replies: text: Agree! The Java code is some what incorrect as you say. I'm not familiar with Java and would like to rewrite the code in C which taking the maximun into account. - Justin545 (talk) 12:59, 28 November 2014 (UTC)
thread_title:  Interval tree example 

message: About querying a tree: so there is a binary search for each node.. that gives O(log^2 n + m) query time.. how is O(log n + m) achieved?
Never mind, I corrected the description. There is no binary search involved, just a simple enumeration.
----------
Actually there is a binary search involved - according to the description, we need to first search S_center (sorted by beginnings) to find the greatest beginning smaller than x. THEN we enumerate.
So the algorithm as presented is indeed O((log n)^2 + m). It can be augmented with additional O(n log n) storage to get back to the O(log n + m): you can keep a separate array of sorted beginnings, and for each beginning x, keep a list of its indices in each of the (log n) sorted S_center lists reached when traversing the main tree with query=x. Basically, you can pre-process and save the results of the binary searches mentioned above.
216.239.45.4 (talk) 22:16, 20 October 2009 (UTC)
thread_title: tree

message: Interesting: it seems Breuwi [rewrote this article], replacing it with what looks like an entirely different datastructure (solving the same problem). The references at the bottom probably don't make much sense anymore now. I wonder how this kind of issue is generally fixed. --Raboof 14:01, 21 February 2007 (UTC)
replies: text: No, it's fundamentally the same data structure but has been made more complicated than necessary. —Pqrstuv 05:35, 28 June 2007 (UTC)
replies: text:  I think you're stretching 'fundamentally the same' to extremes here :) --Raboof 21:48, 2 December 2007 (UTC)

text: In favor ;) --Raboof 21:48, 2 December 2007 (UTC)
thread_title:  Rewrite by Breuwi 

message: It's not at all obvious to me how to use a balanced tree in the alternative implementation when generalised to more than one dimension. The rotations of the tree (required for balancing) will mess up the dividing-in-alternate-dimensions by giving child nodes to inappropriate parents.
: I'm not sure that design scales to higher dimensions - Special:Contributions/198.37.18.99 added that comment and subsequent editors extended it. I'll make the wording somewhat less strong. --Raboof 22:30, 2 December 2007 (UTC)
thread_title:  Alternative implementation 

message: It'd be nice to be able to point readers to good datastructures/algorithms for storing and searching though recurring calendar items, as this is a related use case --Raboof 13:05, 5 October 2007 (UTC)
thread_title:  Reference 

message: I was looking for a data structure that allowed one to query with a point and return whether the point was in any of the intervals in the data structure--that is, without caring which or how many intervals contained it.  Is there a simpler or more efficient data structure for solving such a problem efficiently? Erik Carson (talk) 21:02, 6 April 2011 (UTC)
thread_title:  ITIM 

message: I'm a visual thinker and would pick up the concept much quicker if you included a picture or two.  Better yet, an animation. StuRat (talk) 00:12, 30 April 2014 (UTC)
thread_title:  Please add graphic example 

message: The "Higher dimensions" section does not cite any sources, and it's unclear to me how to use such nested interval trees constructed from the augmented red-black trees described in CLRS. I can't find any mention of such a structure in the literature either. Gyorgy.Kurucz (talk) 11:52, 20 November 2022 (UTC)
thread_title:  Higher dimensional augmented trees