\begin{figure}
\begin{alltt}
function BallTree(data, minimumLeafSize)
  center = centroid of data
  furthestFromCenter = instance from data furthest from center
  furthestFromPrior = instance from data furthest from furthestFromCenter
  
  for each instance in data
    if furthestFromCenter->distance(instance) < furthestFromPrior->distance(instance)
      assign instance to furthestFromCenter
    else
      assign instance to furthestFromPrior
      
  if furthestFromCenter->size() > minimumLeafSize
    furthestFromCenter = BallTree(furthestFromCenter, minimumLeafSize)
    
  if furthestFromPrior->size() > minimumLeafSize
    furthestFromPrior = BallTree
    
  return furthestFromPrior + furthestFromCenter
  
\end{alltt}
\caption{Pseudo code of Ball Trees\cite{BallTrees}}\label{fig:pseudoCode-ball}
\end{figure}
