code: public KdTree construct(List<P> points , boolean trackIndexes )
  	{
  		GrowQueue_I32 indexes = null;
  		if( trackIndexes ) {
  			indexes = new GrowQueue_I32();
  			indexes.resize(points.size());
  			for (int i = 0; i < indexes.size; i++) {
  				indexes.data[i] = i;
  			}
  		}
  
  		KdTree tree = memory.requestTree(splitter.getPointLength());
  
  		if( points.size() == 1 ) {
  			tree.root = createLeaf(points,indexes);
  		} else if( points.size() > 1 ) {
  			tree.root = computeBranch(points, indexes );
  		}
  
  		return tree;
  	}
docs: Creates a new {@link KdTree} from the provided points.
  
  WARNING: Reference to each point is saved to reduce memory usage..
  
  @param points Data points.
  @return KdTre