public void putKthNearest(double d){
  if (m_KthNearest == null) {
    m_KthNearest=new MyHeapElement[initSize];
  }
  if (m_KthNearestSize >= m_KthNearest.length) {
    initSize+=initSize;
    MyHeapElement temp[]=new MyHeapElement[initSize];
    System.arraycopy(m_KthNearest,0,temp,0,m_KthNearest.length);
    m_KthNearest=temp;
  }
  m_KthNearest[m_KthNearestSize++]=new MyHeapElement(d);
}

public void putKthNearest ( double d ) { if ( m_KthNearest == null ) { m_KthNearest = new MyHeapElement [ initSize ] ; } if ( m_KthNearestSize >= m_KthNearest . length ) { initSize += initSize ; MyHeapElement temp [ ] = new MyHeapElement [ initSize ] ; System . arraycopy ( m_KthNearest , 0 , temp , 0 , m_KthNearest . length ) ; m_KthNearest = temp ; } m_KthNearest [ m_KthNearestSize ++ ] = new MyHeapElement ( d ) ; }
stores kth nearest elements ( if there are more than one ) .
