Algorithm
Development Kit 1.0

algs.model.problems
Class EnclosingIntervalSearch

java.lang.Object
  extended by algs.model.problems.EnclosingIntervalSearch

public class EnclosingIntervalSearch
extends java.lang.Object

Given a set S of n intervals and a query point q, report all of those intervals that contain q. That is, find a subset F of S such that:

  F = {I_n | I_n.left <= q <= I_n.right } 
 

Since:
1.0
Version:
1.0, 6/15/08
Author:
George Heineman

Method Summary
static java.util.Set<IInterval> compute(SegmentTree<StoredIntervalsNode> tree, int q)
          Return the computed set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

compute

public static java.util.Set<IInterval> compute(SegmentTree<StoredIntervalsNode> tree,
                                               int q)
Return the computed set.

Parameters:
tree - Segment tree containing the intervals to be searched
q - the target point to be used to check intersection with intervals stored by the tree.
Returns:
the Set of IInterval segments that intersect point q.

Algorithm Development Kit 1.0

This code supports the Algorithms in a Nutshell book, published by O'Reilly Media, Inc. in November 2008. Please visit the book web page to learn of any changes to the code repository or to record a potential defect.